ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. getMaxPlayers

Function

getMaxPlayers

Server and clientServerIdentical to MTA:SA

Returns the number of slots on the server (after a change with setMaxPlayers - the new value).

Syntax

int getMaxPlayers()

Returns

Number of slots.

Example

addEventHandler("onPlayerJoin", root, function()
    outputChatBox(("Graczy: %d/%d"):format(getPlayerCount(), getMaxPlayers()), source)
end)

Notes

Client. Works in a client script too.

See also