SetMaxPlayers: Difference between revisions
Jump to navigation
Jump to search
m ("note" word became bold) |
OpenIDUser28 (talk | contribs) mNo edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server function}} | {{Server function}} | ||
This function | This function sets the maximum number of player slots on the server. | ||
'''Note''': the maximum this function can set is what is defined in mtaserver.conf | '''Note''': the maximum this function can set is what is defined in mtaserver.conf |
Revision as of 13:05, 4 September 2011
This function sets the maximum number of player slots on the server.
Note: the maximum this function can set is what is defined in mtaserver.conf
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