Player.Team

From GMod Wiki

Jump to: navigation, search
Function
Syntax Player:Team( )
Description:
Returns the player's team ID.
Returns: Integer team index
In Object: Player
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Player.Team]Player.Team [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionReturns the team number of the defined player's team.
Used onNewerShared.png
Code
--This function tells the player what team he is on every time he spawns.
function Spawn( ply )
ply:ChatPrint( "You are on team "..ply:Team().." ("..team.GetName( ply:Team() )..")" )
end
 
hook.Add( "PlayerSpawn", "playerSpawn", Spawn )
 
OutputN/A


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox