GetMaxPlayers: Difference between revisions
From Onset Developer Wiki
Created page with "{{Info|Function|Server|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|GetMaxPlayers()}} {{FuncParameters}} {{FuncNoParam}} {{FuncReturnValue|__EDIT_ME__}} == Example..." |
No edit summary |
||
Line 1: | Line 1: | ||
{{Info|Function|Server|1.0}} | {{Info|Function|Server|1.0}} | ||
{{FuncDescription| | {{FuncDescription|Gets the player slots count}} | ||
{{FuncSyntax|GetMaxPlayers()}} | {{FuncSyntax|GetMaxPlayers()}} | ||
Line 8: | Line 8: | ||
{{FuncNoParam}} | {{FuncNoParam}} | ||
{{FuncReturnValue| | {{FuncReturnValue|Returns the player slots count.}} | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua"> | |||
AddCommand("players", function(playerid) | |||
AddPlayerChat(playerid, "Max Players: "..GetMaxPlayers()) | |||
end) | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
* [[GetPlayerCount]] |
Latest revision as of 17:05, 17 November 2019
Description
Gets the player slots count
Syntax
GetMaxPlayers()
Parameters
- This function has no parameters.
Return Value
- Returns the player slots count.
Example
AddCommand("players", function(playerid)
AddPlayerChat(playerid, "Max Players: "..GetMaxPlayers())
end)