Squirrel/Server/Functions/Objects/GetObjectCount

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
Line 25: Line 25:
 
</code>
 
</code>
  
This command will try give the player information on the amount of objects there are in the server.
+
This command will give the player information on the amount of objects there are in the server.
  
 
=== Notes ===
 
=== Notes ===

Revision as of 03:15, 8 March 2010

This function returns the number of objects on the server.

Syntax

  1. int GetObjectCount()

Arguments

  • none

Example

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "objcount" )
  5. {
  6. local objcount = GetObjectCount( );
  7.  
  8. if ( objcount > 0 ) MessagePlayer( "There are currently: " + objcount + " objects!", player );
  9. else MessagePlayer( "There are no objects", player );
  10. }
  11. }
  12.  

This command will give the player information on the amount of objects there are in the server.

Notes

The call onPlayerCommand was used in in this example. More info about this in the corresponding page.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox