Hello uMod developers!
Current shared hooks are don't allow to achieve needs behaviour in plugin.
Can you add some new hooks for in-game teams?
Something like:
OnTeamPayerAdded(RelationshipManager.PlayerTeam team, BasePlayer player) (when player already added to the team)
and
OnTeamPlayerRemoved(RelationshipManager.PlayerTeam team, ulong playerID) (when player already removed from the team)?
I think it can be added in methods of PlayerTeam class:
If you will have time just look at this please!
Thanks in advance!
Current shared hooks are don't allow to achieve needs behaviour in plugin.
Can you add some new hooks for in-game teams?
Something like:
OnTeamPayerAdded(RelationshipManager.PlayerTeam team, BasePlayer player) (when player already added to the team)
and
OnTeamPlayerRemoved(RelationshipManager.PlayerTeam team, ulong playerID) (when player already removed from the team)?
I think it can be added in methods of PlayerTeam class:
public bool AddPlayer(BasePlayer player)
{
ulong num = player.userID;
if (this.members.Contains(num))
{
return false;
}
if (player.currentTeam != 0)
{
return false;
}
if (this.members.Count >= RelationshipManager.maxTeamSize)
{
return false;
}
player.currentTeam = this.teamID;
this.members.Add(num);
RelationshipManager.Instance.playerToTeam.Add(num, this);
this.MarkDirty();
player.SendNetworkUpdate(BasePlayer.NetworkQueue.Update);
//------------- it think here----------------
Interface.CallHook("OnTeamPlayerAdded", this, basePlayer);
//-----------------------------
return true;
}public bool RemovePlayer(ulong playerID)
{
if (!this.members.Contains(playerID))
{
return false;
}
this.members.Remove(playerID);
RelationshipManager.Instance.playerToTeam.Remove(playerID);
BasePlayer basePlayer = RelationshipManager.FindByID(playerID);
if (basePlayer != null)
{
basePlayer.ClearTeam();
basePlayer.BroadcastAppTeamRemoval();
}
if (this.teamLeader == playerID)
{
if (this.members.Count <= 0)
{
this.Disband();
}
else
{
this.SetTeamLeader(this.members[0]);
}
}
this.MarkDirty();
//------------- it think here----------------
Interface.CallHook("OnTeamPlayerRemoved", this, playerID);
//-----------------------------
return true;
}If you will have time just look at this please!
Thanks in advance!