SetMaxPlayers
From Multi Theft Auto: Wiki
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
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
- addCommandHandler
- executeCommandHandler
- fromJSON
- getFPSLimit
- getMaxPlayers
- getServerHttpPort
- getServerName
- getServerPassword
- getServerPort
- getVersion
- isGlitchEnabled
- outputChatBox
- outputConsole
- outputDebugString
- outputServerLog
- removeCommandHandler
- setFPSLimit
- setGlitchEnabled
- setMaxPlayers
- setServerPassword
- showChat
- shutdown
- toJSON