Squirrel/Server/Functions/Server/SetMaxPlayers
From Liberty Unleashed Wiki
(Difference between revisions)
m (Squirrel/Functions/Server/SetMaxPlayers moved to Squirrel/Server/Functions/Server/SetMaxPlayers: Separating from clientside scripts) |
|||
Line 1: | Line 1: | ||
− | + | {{Squirrel/Title|SetMaxPlayers}} | |
Changes the maximum players limit of the server. | Changes the maximum players limit of the server. | ||
Revision as of 10:21, 11 October 2010
Changes the maximum players limit of the server.
Syntax
bool SetMaxPlayers( int limit )
Arguments
- limit - The number of players allowed to join you want to set
Example
This example will change the server player limit when a player types '/setlimit 20'
function OnPlayerCommand( id, cmd, text ) { if ( cmd == "setlimit" ) { SetMaxPlayers( text.tointeger() ); } }
Notes
The call OnPlayerCommand was also used in the example. More info about this in the corresponding page.