Squirrel/Client/Functions/Players/Angle

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with '{{Squirrel/Title|Player.Angle}} This function sets/returns a given player's facing angle. Setting the angle only affects the local player. == Syntax == <code>float Player.Angleā€¦')
 

Latest revision as of 04:27, 24 September 2011

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function sets/returns a given player's facing angle. Setting the angle only affects the local player.

[edit] Syntax

  1. float Player.Angle( float Angle )

[edit] Arguments

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

[edit] Example 1. Returning

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

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

[edit] Example 2. Setting

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

This will set the local player's facing angle to be north.

[edit] Notes

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

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox