Squirrel/Server/Functions/Players/Angle

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(New page: __NOTOC__ This function sets/returns the players facing angle. == Syntax == <code>float Player.Angle( float Angle )</code> == Arguments == * '''Angle''' - What you can set the facing a...)
 
(Notes)
Line 41: Line 41:
 
=== Notes ===
 
=== Notes ===
  
The call [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] [[Squirrel/Server/Functions/Messages/MessagePlayer|MessagePlayer]] were used in in this example. More info about them in the corresponding page.
+
The call [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] and [[Squirrel/Server/Functions/Messages/MessagePlayer|MessagePlayer]] were used in in this example. More info about them in the corresponding page.
  
 
== Related Functions ==
 
== Related Functions ==
  
 
{{Squirrel/Server/Functions/Players}}
 
{{Squirrel/Server/Functions/Players}}

Revision as of 02:40, 26 May 2010

This function sets/returns the players facing angle.

Syntax

  1. float Player.Angle( float Angle )

Arguments

  • Angle - What you can set the facing angle too.

Example 1. Returning

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "angle" )
  5. {
  6. MessagePlayer( "Your facing angle is " + pPlayer.Angle + ".", pPlayer );
  7. }
  8. }
  9.  

This will tell the player what their facing angle currently is.

Example 2. Setting

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "setangle" )
  5. {
  6. pPlayer.Angle = 0.00;
  7. }
  8. }
  9.  

This will set the players facing angle to be north.

Notes

The call onPlayerCommand and MessagePlayer were used in in this example. More info about them in the corresponding page.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox