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|__EDIT_ME__}}
{{FuncDescription|Gets the player slots count}}


{{FuncSyntax|GetMaxPlayers()}}
{{FuncSyntax|GetMaxPlayers()}}
Line 8: Line 8:
{{FuncNoParam}}
{{FuncNoParam}}


{{FuncReturnValue|__EDIT_ME__}}
{{FuncReturnValue|Returns the player slots count.}}


== Example ==
== Example ==
__EDIT_ME__
<syntaxhighlight lang="Lua">
AddCommand("players", function(playerid)
AddPlayerChat(playerid, "Max Players: "..GetMaxPlayers())
end)
</syntaxhighlight>


{{RelatedFunctions}}
{{RelatedFunctions}}
__EDIT_ME__
* [[GetPlayerCount]]

Latest revision as of 17:05, 17 November 2019

GetMaxPlayers

Type: Function
Context: Server
Introduced: v1.0

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)

See also