SpawnClass.SpawnScreen
From Liberty Unleashed Wiki
This SpawnClass class member returns or sets the ID of the pre-defined spawnscreen (see Content.xml) for the given spawn class.
Syntax
You can either return or set a new value using this member:
int SpawnClass.SpawnScreen
SpawnClass.SpawnScreen = int screenID
Arguments
- screenID - This is the ID of the spawnscreen defined in content.xml
Example 1. Returning
function onPlayerCommand( player, cmd, text ) { if ( cmd == "getscreen" ) { local screen = p_SpawnClass.SpawnScreen; MessagePlayer( "The current spawn screen id is: " + screen, player ); } }
This example will return the spawn screen id of the spawn class, that we found earlier in FindSpawnClass.
Example 2. Setting
function onPlayerCommand( player, cmd, text ) { if ( cmd == "setscreen" ) { local screen; if ( text ) screen = text.tointeger(); if ( screen ) p_SpawnClass.SpawnScreen = screen; } }
This example will set the spawn screen of the spawn class, that we found earlier in FindSpawnClass.
Notes
The call onPlayerCommand was used in in this example. More info about this in the corresponding page.