team.GetPlayers

From GMod Wiki

Revision as of 13:27, 17 June 2010 by Roelof (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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