Squirrel/Server/Functions/SpawnClass/GetSpawnClassCount

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(New page: __NOTOC__ This function returns the number of different spawn classes on the server. == Syntax == <code>int GetSpawnClassCount()</code> == Arguments == * '''none''' == Example == {{S...)
 
(Example)
Line 12: Line 12:
 
== Example ==
 
== Example ==
  
{{Squirrel/NeedsExample}}
 
 
<code lang="squirrel">
 
<code lang="squirrel">
-- todo
+
function onPlayerCommand( player, cmd, text )
 +
{
 +
if ( cmd == "spawncount" )
 +
{
 +
local count = GetSpawnClassCount( );
 +
MessagePlayer( "The current spawn class count is: " + count, player );
 +
}
 +
}
 
</code>
 
</code>
 +
 +
This example will return the number of spawn classes.
  
 
=== 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/SpawnClass}}
 
{{Squirrel/Server/Functions/SpawnClass}}

Revision as of 17:29, 8 March 2010

This function returns the number of different spawn classes on the server.

Syntax

  1. int GetSpawnClassCount()

Arguments

  • none

Example

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

This example will return the number of spawn classes.

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