SetMaxPlayers: Difference between revisions
Jump to navigation
Jump to search
OpenIDUser28 (talk | contribs) mNo edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
This function sets the maximum number of player slots on the server. | This function sets the maximum number of player slots on the server. | ||
'''Note''': | '''Note''': This function can not set more than <maxplayers> as defined in [[mtaserver.conf]]. (To find out the <maxplayers> value, use getServerConfigSetting("maxplayers")) | ||
==Syntax== | ==Syntax== |
Revision as of 21:03, 20 December 2012
This function sets the maximum number of player slots on the server.
Note: This function can not set more than <maxplayers> as defined in mtaserver.conf. (To find out the <maxplayers> value, use getServerConfigSetting("maxplayers"))
Syntax
bool setMaxPlayers ( int slots )
Required Arguments
- slots: Maximum number of player slots on the server.
Returns
Returns true if number of player slots was successfully changed, false or nil otherwise.
Example
This example set server slots count to half value from current value.
local curMaxPlayers = getMaxPlayers() local newMaxPlayers = math.ceil( curMaxPlayers / 2 ) setMaxPlayers( newMaxPlayers )
See Also
- getMaxPlayers
- getServerConfigSetting
- getServerHttpPort
- getServerName
- getServerPassword
- getServerPort
- isGlitchEnabled
- setGlitchEnabled
- setMaxPlayers
- setServerConfigSetting
- setServerPassword
- shutdown