SpawnClass.Angle
From Liberty Unleashed Wiki
This SpawnClass class member returns or sets the spawn rotation for the given spawn class.
Syntax
You can either return or set a new value using this member:
float SpawnClass.Angle
SpawnClass.Angle = float angle
Arguments
- angle - This is the new spawn rotation for the class
Example 1. Returning
function onPlayerCommand( player, cmd, text ) { if ( cmd == "getangle" ) { local ang = p_SpawnClass.Angle; MessagePlayer( "The spawning angle of this class is: " + ang, player ); } }
This example will return the spawning angle of the spawn class that we found earlier in FindSpawnClass.
Example 2. Setting
function onPlayerCommand( player, cmd, text ) { if ( cmd == "setangle" ) { if ( text ) p_SpawnClass.Angle = text.tofloat(); } }
This example will set the spawning angle of the spawn class that we found earlier in FindSpawnClass to the angle specified in the text parameter.
Notes
The call onPlayerCommand was used in in this example. More info about this in the corresponding page.