Squirrel/Server/Functions/Server/GetPlayers
From Liberty Unleashed Wiki
(Difference between revisions)
(New page: __NOTOC__ This returns the number of players currently playing on the server. == Syntax == <code>string GetPlayers()</code> == Arguments == *'''None''' == Example == This command wil...) |
|||
Line 1: | Line 1: | ||
− | + | {{Squirrel/Title|GetPlayers}} | |
This returns the number of players currently playing on the server. | This returns the number of players currently playing on the server. | ||
Revision as of 10:21, 11 October 2010
This returns the number of players currently playing on the server.
Syntax
string GetPlayers()
Arguments
- None
Example
This command will return the number of players in the server when someone types /players'.
function OnPlayerCommand( id, cmd, text ) { if ( cmd == "players" ) { Message( "There are currently " + GetPlayers() + " players in-game.", id ); } }
Notes
The function MessagePlayer and call OnPlayerCommand were used in in this example. More info about them in corresponding pages.