team.BestAutoJoinTeam

From GMod Wiki

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