Squirrel/Server/Functions/SpawnClass/SpawnScreen

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
 
Line 1: Line 1:
 
{{Squirrel/Title|SpawnClass.SpawnScreen}}
 
{{Squirrel/Title|SpawnClass.SpawnScreen}}
This ''SpawnClass'' class member returns or sets the ID of the pre-defined spawnscreen (check content.xml) for the given spawn class.
+
This ''SpawnClass'' class member returns or sets the ID of the pre-defined spawnscreen (see [[Content.xml]]) for the given spawn class.
  
 
== Syntax ==
 
== Syntax ==

Latest revision as of 10:42, 11 October 2010

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

This SpawnClass class member returns or sets the ID of the pre-defined spawnscreen (see Content.xml) for the given spawn class.

[edit] Syntax

You can either return or set a new value using this member:

  1. int SpawnClass.SpawnScreen
  1. SpawnClass.SpawnScreen = int screenID

[edit] Arguments

  • screenID - This is the ID of the spawnscreen defined in content.xml

[edit] Example 1. Returning

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "getscreen" )
  5. {
  6. local screen = p_SpawnClass.SpawnScreen;
  7. MessagePlayer( "The current spawn screen id is: " + screen, player );
  8. }
  9. }
  10.  

This example will return the spawn screen id of the spawn class, that we found earlier in FindSpawnClass.

[edit] Example 2. Setting

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "setscreen" )
  5. {
  6. local screen;
  7. if ( text ) screen = text.tointeger();
  8. if ( screen ) p_SpawnClass.SpawnScreen = screen;
  9. }
  10. }
  11.  

This example will set the spawn screen of the spawn class, that we found earlier in FindSpawnClass.

[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