Skip to content

OnTeamPromote

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private void OnTeamPromote( PlayerTeam playerTeam, BasePlayer lookingAtPlayer )
{
    Puts( "OnTeamPromote works!" );
}

Location

  • RelationshipManager::promote(ConsoleSystem/Arg arg)
csharp
//---
	if (lookingAtPlayer.currentTeam == basePlayer.currentTeam)
	{
		RelationshipManager.PlayerTeam playerTeam = RelationshipManager.ServerInstance.teams[basePlayer.currentTeam];
		if (playerTeam != null && playerTeam.teamLeader == basePlayer.userID)
		{
			if (Interface.CallHook("OnTeamPromote", playerTeam, lookingAtPlayer) != null)
			{
				return;
			}
			playerTeam.SetTeamLeader(lookingAtPlayer.userID);
		}
//---

Released under the MIT License.