SpawnClass.Angle

From Liberty Unleashed Wiki
Revision as of 10:38, 11 October 2010 by VRocker (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

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:

  1. float SpawnClass.Angle
  1. SpawnClass.Angle = float angle

Arguments

  • angle - This is the new spawn rotation for the class

Example 1. Returning

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "getangle" )
  5. {
  6. local ang = p_SpawnClass.Angle;
  7. MessagePlayer( "The spawning angle of this class is: " + ang, player );
  8. }
  9. }
  10.  

This example will return the spawning angle of the spawn class that we found earlier in FindSpawnClass.

Example 2. Setting

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

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.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox