team.BestAutoJoinTeam

From GMod Wiki

Revision as of 19:47, 6 May 2011 by | PoKi | Judge Dredd (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
Syntax team.BestAutoJoinTeam( )
Where is this used?
Description:
Returns the smallest team.
Returns: Number
Part of Library: team
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Team.BestAutoJoinTeam]Team.BestAutoJoinTeam [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionAuto-assign player to open team upon join.
Used onGamemodes
Code
function GM:PlayerInitialSpawn( ply ) 
	self.BaseClass:PlayerInitialSpawn( ply )
	ply:SetTeam ( team.BestAutoJoinTeam() )
end
Output
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox