GetMaxPlayers: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
__NOTOC__
__NOTOC__
==Description==
This function returns the maximum number of player slots on the server.
This function returns the maximum number of player slots on the server.


Line 6: Line 5:
<syntaxhighlight lang="lua">int getMaxPlayers ()</syntaxhighlight>
<syntaxhighlight lang="lua">int getMaxPlayers ()</syntaxhighlight>


==Required Arguments==
===Returns===
''This function has no arguments.''
Returns the maximum number of players allowed on the server.


==Example==
==Example==
<syntaxhighlight lang="lua">playermax = GetMaxPlayers ()
This example gets the maximum number of players for the server and outputs it as part of a message in the chat box.
outputChatBox ( "There are currently ", playermax, " player slots in this server." )</syntaxhighlight>
<syntaxhighlight lang="lua">playermax = getMaxPlayers ()
outputChatBox ( "There are currently " .. playermax .. " player slots in this server." )</syntaxhighlight>


==See Also==
==See Also==
{{Server functions}}
{{Server functions}}

Revision as of 11:03, 14 August 2006

This function returns the maximum number of player slots on the server.

Syntax

int getMaxPlayers ()

Returns

Returns the maximum number of players allowed on the server.

Example

This example gets the maximum number of players for the server and outputs it as part of a message in the chat box.

playermax = getMaxPlayers ()
outputChatBox ( "There are currently " .. playermax .. " player slots in this server." )

See Also