SetPlayerTeam

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 16:47, 16 January 2011
VWOer (Talk | contribs)

← Previous diff
Revision as of 02:01, 27 July 2012
Calgon (Talk | contribs)

Next diff →
Line 5: Line 5:
{{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 each other unless they use a knife.}}
 +
 +{{note|-1 is the default team to be able to shoot other players, not 0.}}
{{Parameters|playerid, teamid}} {{Parameters|playerid, teamid}}

Revision as of 02:01, 27 July 2012


Set the team of a player


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


Image:32px-Ambox_warning_orange.png Note: -1 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.


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