SetMaxPlayers

From Liberty Unleashed Wiki
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function changes the maximum player limit of the server.

Syntax

  1. bool SetMaxPlayers( int limit )

Arguments

  • limit - The number of players allowed to join

Example

This example will change the server player limit when a player types '/setlimit 20'

  1.  
  2. function onPlayerCommand( plr, cmd, text )
  3. {
  4. if ( cmd == "setlimit" )
  5. {
  6. SetMaxPlayers( text.tointeger() );
  7. }
  8. return 1;
  9. }
  10.  

Notes

The call onPlayerCommand was also used in the example. More info about it can be found in the corresponding page.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox