ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server events
  3. onPlayerTeamChange

Event

onPlayerTeamChange

ServerPlayersIdentical to MTA:SA

A player changed team (setPlayerTeam).

Handler

addEventHandler("onPlayerTeamChange", root, function(oldTeam, newTeam) ... end)

Parameters

oldTeamteam
Previous team or false.
newTeamteam
New team or false.

Source

source is the player.

Example

addEventHandler("onPlayerTeamChange", root, function(old, new)
    if new then outputChatBox("Witaj w drużynie " .. getTeamName(new), source) end
end)

See also