Squirrel/Server/Functions/SpawnClass/Angle

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example 1. Returning)
(Example 1. Returning)
Line 18: Line 18:
 
if ( cmd == "getangle" )
 
if ( cmd == "getangle" )
 
{
 
{
local ang = p_SpawnClass.GetAngle( );
+
local ang = p_SpawnClass.Angle( );
 
MessagePlayer( "The spawning angle of this class is: " + ang, player );
 
MessagePlayer( "The spawning angle of this class is: " + ang, player );
 
}
 
}

Revision as of 17:22, 8 March 2010

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

This function needs an example. You can help us complete the wiki by writing one, or maybe even more :o
  1.  
  2. -- todo
  3.  

Notes

-- Example notes/used functions here

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox