Squirrel/Server/Functions/SpawnClass/FindSpawnClass

From Liberty Unleashed Wiki
Revision as of 17:16, 8 March 2010 by Force (Talk | contribs)

Jump to: navigation, search

This function finds a SpawnClass from an ID and returns the pointer. If no spawn class is found, null will be returned.

Syntax

  1. SpawnClass FindSpawnClass( int id )

Arguments

  • id - The ID of the spawn class to be found
  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "findclass" )
  5. {
  6. if ( text ) p_SpawnClass <- FindSpawnClass( text.tointeger() );
  7. }
  8. }
  9.  

This example will try and find a spawn class associated with the specified id.

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