Squirrel/Server/Functions/Vehicles/GetVehicleCount

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(New page: __NOTOC__ This function returns the number of vehicles ingame. == Syntax == <code>int GetVehicleCount()</code> == Arguments == * '''none''' == Example == {{Squirrel/NeedsExample}} <c...)
 
(Example)
Line 12: Line 12:
 
== Example ==
 
== Example ==
  
{{Squirrel/NeedsExample}}
 
 
<code lang="squirrel">
 
<code lang="squirrel">
-- todo
+
function onPlayerCommand( player, cmd, text )
 +
{
 +
if ( cmd == "vehcount" )
 +
{
 +
local count = GetVehicleCount();
 +
MessagePlayer( "The current vehicle count is: " + count, player );
 +
}
 +
}
 
</code>
 
</code>
 +
 +
This command will return how many vehicles are currently in the server.
  
 
=== Notes ===
 
=== Notes ===
  
-- Example notes/list of used functions here
+
The call [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] was used in in this example. More info about this in the corresponding page.
  
 
== Related Functions ==
 
== Related Functions ==
  
 
{{Squirrel/Server/Functions/Vehicles}}
 
{{Squirrel/Server/Functions/Vehicles}}

Revision as of 14:38, 8 March 2010

This function returns the number of vehicles ingame.

Syntax

  1. int GetVehicleCount()

Arguments

  • none

Example

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "vehcount" )
  5. {
  6. local count = GetVehicleCount();
  7. MessagePlayer( "The current vehicle count is: " + count, player );
  8. }
  9. }
  10.  

This command will return how many vehicles are currently 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