Squirrel/Server/Functions/SpawnClass/FindSpawnClass

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
 
Line 1: Line 1:
__NOTOC__
+
{{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

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

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

[edit] Syntax

  1. SpawnClass FindSpawnClass( int id )

[edit] 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.

[edit] Notes

The call onPlayerCommand was used in in this example. More info about this in the corresponding page.

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox