SpawnClass.Colour

From Liberty Unleashed Wiki
Jump to: navigation, search


This SpawnClass class member returns or sets the ID of the pre-defined colour (check content.xml) for the given spawn class.

Syntax

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

  1. int SpawnClass.Colour
  1. SpawnClass.Colour = int colourID

Arguments

  • colourID - This is the ID of the colour defined in content.xml

Example 1. Returning

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

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "colour" )
  5. {
  6. local col = p_SpawnClass.Colour;
  7. MessagePlayer( "The spawn class colour is currently: " + col, player );
  8. }
  9. }
  10.  

Notes

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

Example 2. Setting

This example will set the colour of the spawn class, that we found earlier in FindSpawnClass, to predefined colour 2.

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "setcolour" )
  5. {
  6. p_SpawnClass.Colour = 2;
  7. }
  8. }
  9.  

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