Squirrel/Server/Functions/SpawnClass/GetSpawnClassCount
From Liberty Unleashed Wiki
(Difference between revisions)
(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 == | ||
− | |||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | + | 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 === | ||
− | + | 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
int GetSpawnClassCount()
Arguments
- none
Example
function onPlayerCommand( player, cmd, text ) { if ( cmd == "spawncount" ) { local count = GetSpawnClassCount( ); MessagePlayer( "The current spawn class count is: " + count, player ); } }
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.