team.GetPlayers

From GMod Wiki

Jump to: navigation, search
Function
Syntax team.GetPlayers( Integer TeamIndex )
Where is this used?
Description:
Gets all the players in the specific Team.
Returns: Table Players
Part of Library: Team
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Team.GetPlayers]Team.GetPlayers [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionGets Team 1's players and display their name in the console.
Used onNewerShared.png
Code
 
for _,ply in pairs(team.GetPlayers(1)) do
  print(ply:GetName())
end
 
OutputOutputs Team 1's player names in Console.


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox