SpawnClass.Colour
From Liberty Unleashed Wiki
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:
int SpawnClass.Colour
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.
function onPlayerCommand( player, cmd, text ) { if ( cmd == "colour" ) { local col = p_SpawnClass.Colour; MessagePlayer( "The spawn class colour is currently: " + col, player ); } }
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.
function onPlayerCommand( player, cmd, text ) { if ( cmd == "setcolour" ) { p_SpawnClass.Colour = 2; } }
Notes
The call onPlayerCommand was used in in this example. More info about this in the corresponding page.