Difference between revisions of "0170"

From GTAMods Wiki
Jump to navigation Jump to search
(works without category (tempate does the thing))
(page updates)
Line 1: Line 1:
{{OpCode
+
{{Icon|3}} {{Icon|VC}} '''GET_PLAYER_HEADING'''
| ini        = 0170=2,%2d% %1d%
+
<hr />
| description = Gets the Z [[angle]] of the player
+
'''Description'''
| p1          = Player handle
+
: Gets the heading of the player
| p2          = Variable to store the angle
+
'''Syntax'''
| game        = GTA3, Vice City
+
: 0170: [''var''] = player [''player handle''] z_angle
}}
+
'''Parameter'''
This gets the Z angle of the player and stores it into a variable. The angle is in degrees. This opcode does not work in San Andreas so use [[0172]] instead. Note that the parameters are swapped.
+
: [''var'']
[[Sanny Builder]] example:<source lang="scm">0170: 0@ = player $PLAYER_CHAR Z_angle</source>
+
:: Variable to store the heading
 +
: [''player handle'']
 +
:: The handle of the [[0053|player]]
  
==Note==
+
This opcode gets the heading (Z angle) of the player. Opcode [[0172]] is the equivalent for characters.
The above format is more commonly used. The actual format of this opcode is in order:<br>
 
<code>0170=2,%1d% %2d%</code><br>
 
The format to use depends on which INI file you use.
 
  
==Keywords==
+
{{direction|deg=1}}
get, store, player, angle
+
 
 +
== Keywords ==
 +
get, store, player, angle, heading
 +
 
 +
[[Category:OpCodes]]

Revision as of 18:09, 12 January 2015

GTA III Vice City GET_PLAYER_HEADING


Description

Gets the heading of the player

Syntax

0170: [var] = player [player handle] z_angle

Parameter

[var]
Variable to store the heading
[player handle]
The handle of the player

This opcode gets the heading (Z angle) of the player. Opcode 0172 is the equivalent for characters.

Compass Degrees Radians
North 0
West 90° π/2 ≈ 1.57
South 180° π ≈ 3.14
East 270° 3π/2 ≈ 4.71

Keywords

get, store, player, angle, heading