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...) |
Revision as of 02:59, 7 January 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.