Squirrel/Functions/Server/GetMaxPlayers

From VC-MP Wiki

Jump to: navigation, search

This returns the maximum ammount of players allowed in the server.

Syntax

int GetMaxPlayers()

Arguments

  • None

Example

This example will return the max players when a player types '/c maxplayers'.

function onPlayerCommand( player, cmd, text )
{
     if ( cmd == "maxplayers" )
     {
          MessagePlayer( "The maximum ammount of players allowed on this server is " + GetMaxPlayers(), player );
     }
}

Notes

The function MessagePlayer and call onPlayerCommand were used in in this example. More info about them in corresponding pages.

Related Functions

squirrel scripting