GetPlayerTeam
Jump to navigation
Jump to search
This function is used to get the current team a player is on.
Syntax
team getPlayerTeam ( player thePlayer )
Required Arguments
- thePlayer: The player whose team you want to find out.
Example
This example finds the team a player is on, and then changes its name.
addCommandHandler ( "teamName", "teamName" ) function teamName ( source, key, newTeamName ) team = getPlayerTeam ( source ) -- get the player's team if ( team ) then -- if he's on a team teamName = getTeamName ( team ) -- get the teams current name setTeamName ( team, newTeamName ) -- change its name outputChatBox ( "Changed "..getClientName ( source ).."'s team name from "..teamName.." to "..newTeamName ) else outputChatBox ( getClientName ( source ).." isn't on a team" ) end end
See Also
- getPlayerTeam
- getPlayerBlurLevel
- setPlayerBlurLevel
- getPlayerSerial
- forcePlayerMap
- getPlayerScriptDebugLevel
- getPlayerFromName
- getPlayerMoney
- getPlayerName
- getPlayerNametagColor
- getPlayerNametagText
- getPlayerPing
- getPlayerWantedLevel
- givePlayerMoney
- isPlayerMapForced
- isPlayerNametagShowing
- setPlayerHudComponentVisible
- setPlayerMoney
- setPlayerNametagColor
- setPlayerNametagShowing
- setPlayerNametagText
- takePlayerMoney
- countPlayersInTeam
- getPlayersInTeam
- isVoiceEnabled
- setControlState
- getControlState