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

Function

getPlayerTeam

ServerPlayersIdentical to MTA:SA

Returns the player's team.

Syntax

team getPlayerTeam(player thePlayer)

Arguments

thePlayerplayer
The player.

Returns

The team or false.

Example

addEventHandler("onPlayerDamage", root, function(attacker)
    if attacker and getElementType(attacker) == "player" and getPlayerTeam(attacker) == getPlayerTeam(source) then
        outputChatBox("Nie strzelaj do swoich!", attacker, 255, 0, 0)
    end
end)

See also