Squirrel/Server/Functions/SpawnClass/FindSpawnClass
From Liberty Unleashed Wiki
(Difference between revisions)
Line 1: | Line 1: | ||
− | + | {{Squirrel/Title|FindSpawnClass}} | |
This function finds a ''SpawnClass'' from an ID and returns the pointer. If no spawn class is found, ''null'' will be returned. | This function finds a ''SpawnClass'' from an ID and returns the pointer. If no spawn class is found, ''null'' will be returned. | ||
Latest revision as of 10:37, 11 October 2010
This function finds a SpawnClass from an ID and returns the pointer. If no spawn class is found, null will be returned.
[edit] Syntax
SpawnClass FindSpawnClass( int id )
[edit] Arguments
- id - The ID of the spawn class to be found
function onPlayerCommand( player, cmd, text ) { if ( cmd == "findclass" ) { if ( text ) p_SpawnClass <- FindSpawnClass( text.tointeger() ); } }
This example will try and find a spawn class associated with the specified id.
[edit] Notes
The call onPlayerCommand was used in in this example. More info about this in the corresponding page.