ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. setPlayerTeam

Function

setPlayerTeam

ServerPlayersIdentical to MTA:SA

Assigns a player to a team. nil or false removes them from the team. Fires onPlayerTeamChange.

Syntax

bool setPlayerTeam(player thePlayer, team theTeam)

Arguments

thePlayerplayer
The player.
theTeamteam
A team or nil.

Returns

true on success.

Example

addCommandHandler("policja", function(player)
    setPlayerTeam(player, getTeamFromName("Policja"))
    setElementModel(player, 280)
end)

See also