SetPlayerTeam
From SA-MP Wiki
(Difference between revisions)
Revision as of 21:42, 11 April 2013 Smithy (Talk | contribs) (No longer RC) ← Previous diff |
Revision as of 04:56, 2 February 2014 Connor Mead (Talk | contribs) Next diff → |
||
Line 1: | Line 1: | ||
{{Scripting}} | {{Scripting}} | ||
- | {{Title}} | ||
{{Description|Set the team of a player.}} | {{Description|Set the team of a player.}} | ||
Line 31: | Line 30: | ||
[[de:setPlayerTeam]] | [[de:setPlayerTeam]] | ||
+ | [[fr:SetPlayerTeam]] |
Revision as of 04:56, 2 February 2014
Description:
Set the team of a player.
Note | Players can not damage/kill players on the same team unless they use a knife to slit their throat. As of SA-MP 0.3x, players are also unable to damage vehicles driven by a player from the same team. This can be enabled with EnableVehicleFriendlyFire. |
(playerid, teamid)
playerid | The ID of the player you want to set the team of. |
teamid | The team to put the player in. Use NO_TEAM to remove the player from any team. |
Return Values:
This function does not return any specific values.
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.
- GetPlayerTeam: Check what team a player is on.
- SetTeamCount: Set the number of teams available.
- EnableVehicleFriendlyFire: Enable friendly fire for team vehicles.