SetPlayerTeam
From SA-MP Wiki
SetPlayerTeam
Even though this function wasn't of much use in the previous version, it enables you to make use of the anti-teamkill option in SA-MP 0.2. You can use any team, but every player starts with teamID 0 by default. You can define the maximum amount of teams using SetTeamCount
(playerid, teamid)
| playerid | The PlayerID of who you want to change the team of. |
| teamid | The new Team ID the player will recieve. |
This function does not return a specific value, it's best to simply ignore it.
public OnPlayerSpawn( playerid ) { // Update this player's team to number 4 at spawning, you should check // the player's skin when used in a gamemode. SetPlayerTeam( playerid, 4 ); return 1; }
Related Functions
The following functions might be useful as well, as they're related to this function in one way or another.
- GetPlayerTeam: Check what team a player is on.
- SetTeamCount: Set the number of teams available.
