Entity::position: Difference between revisions

From RAGE Multiplayer Wiki
mNo edit summary
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{ServersideJsFunction}}
__TOC__
This property gets/sets the entity position.
This property gets/sets the entity position.


Line 8: Line 12:


== Example ==
== Example ==
{{ServerSideCode|
{{ServersideCode|
<syntaxhighlight lang="javascript">
<pre>
const playerPos = player.position
const playerPos = player.position
console.log(playerPos) // return e.g. {x: 1337, y: 228, z: 70}
console.log(playerPos) // return e.g. {x: 1337, y: 228, z: 70}
player.position = new mp.Vector3(0.0, 0.0, 72.0);
player.position = new mp.Vector3(0.0, 0.0, 72.0);
</syntaxhighlight>
</pre>
}}
}}



Latest revision as of 10:23, 11 November 2019

Server-Side
Function

 JavaScript



This property gets/sets the entity position.

Getter

  • Vector3

Setter

  • Vector3

Example

Server-Side
const playerPos = player.position
console.log(playerPos) // return e.g. {x: 1337, y: 228, z: 70}
player.position = new mp.Vector3(0.0, 0.0, 72.0);

See Also