GetPlayerCount: Difference between revisions
From Onset Developer Wiki
X7airworker (talk | contribs) No edit summary |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 11: | Line 11: | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua"> | |||
AddCommand("players", function(playerid) | |||
AddPlayerChat(playerid, "Players online: "..GetPlayerCount()) | |||
end) | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
* [[GetMaxPlayers]] |
Revision as of 17:03, 17 November 2019
Description
Gets the count of the online players.
Syntax
GetPlayerCount()
Parameters
- This function has no parameters.
Return Value
- Count of players.
Example
AddCommand("players", function(playerid)
AddPlayerChat(playerid, "Players online: "..GetPlayerCount())
end)