Squirrel/Functions/Server/SetMaxPlayers

From VC-MP Wiki

Jump to: navigation, search

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 '/c setlimit 20'

function onPlayerCommand( player, 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.

Related Functions

squirrel scripting