Squirrel/Server/Functions/Objects/GetObjectCount
From Liberty Unleashed Wiki
(Difference between revisions)
Line 1: | Line 1: | ||
− | + | {{Squirrel/Title|GetObjectCount}} | |
This function returns the number of objects on the server. | This function returns the number of objects on the server. | ||
Latest revision as of 10:51, 11 October 2010
This function returns the number of objects on the server.
[edit] Syntax
int GetObjectCount()
[edit] Arguments
- none
[edit] Example
function onPlayerCommand( player, cmd, text ) { if ( cmd == "objcount" ) { local objcount = GetObjectCount( ); if ( objcount > 0 ) MessagePlayer( "There are currently: " + objcount + " objects!", player ); else MessagePlayer( "There are no objects", player ); } }
This command will give the player information on the amount of objects there are in the server.
[edit] Notes
The call onPlayerCommand was used in in this example. More info about this in the corresponding page.