SetPlayerTeam

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 02:01, 27 July 2012
Calgon (Talk | contribs)

← Previous diff
Revision as of 10:26, 28 July 2012
Amit B (Talk | contribs)

Next diff →
Line 2: Line 2:
{{Title}} {{Title}}
-{{Description|Set the team of a player}}+{{Description|Set the team of a player.}}
-{{note|Players on the same team can not kill each other unless they use a knife.}}+{{note|Players on the same team can not kill or damage each other unless they use a knife.}}
-{{note|-1 is the default team to be able to shoot other players, not 0.}}+{{note|255 (or NO_TEAM) is the default team to be able to shoot other players, not 0.}}
{{Parameters|playerid, teamid}} {{Parameters|playerid, teamid}}
{{Param|playerid|The ID of the player you want to set the team of.}} {{Param|playerid|The ID of the player you want to set the team of.}}
-{{Param|teamid|The team to put the player in.}}+{{Param|teamid|The team to put the player in. Use NO_TEAM to remove the player from any team.}}
{{NoReturn}} {{NoReturn}}

Revision as of 10:26, 28 July 2012


Set the team of a player.


Image:32px-Ambox_warning_orange.png Note: Players on the same team can not kill or damage each other unless they use a knife.


Image:32px-Ambox_warning_orange.png Note: 255 (or NO_TEAM) is the default team to be able to shoot other players, not 0.


Parameters:
(playerid, teamid)
playeridThe ID of the player you want to set the team of.
teamidThe team to put the player in. Use NO_TEAM to remove the player from any team.


ReturnsThis function doesn't return a specific value


public OnPlayerSpawn(playerid)
{
    // Set a player's team to 4 when they spawn
    SetPlayerTeam(playerid, 4);
    return 1;
}

Related Functions

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

Personal tools