GetPlayerTeam

GetPlayerTeam

Description:
Function GetPlayerTeam get the ID of the team the player is on.


Parameters:
(playerid)
int playerid The ID of the player to get the team of.


Return Values:
  • 0-254: The player's team. (0 is a valid team)
  • 255: Defined as NO_TEAM. The player is not on any team.
  • -1: The function failed to execute. Player is not connected.


Examples:
public OnPlayerSpawn(playerid)
{
    // Players who are in team 1 should spawn at Las Venturas airport.
    if(GetPlayerTeam(playerid) == 1) SetPlayerPos(playerid, 1667.8909, 1405.5618, 10.7801);
    return 1;
}


Related Functions
The following functions may be useful, as they are related to this function in one way or another.