PlayerClient

getPlayerWantedCentrePosition

GET_PLAYER_WANTED_CENTRE_POSITION0x0C92BA89F1AF26F8

The GTA V native GET_PLAYER_WANTED_CENTRE_POSITION of the PLAYER namespace, as LS:MP client scripts call it: the global function getPlayerWantedCentrePosition, in JavaScript and in Lua.

SignatureJavaScript
getPlayerWantedCentrePosition(
  player: Player
): { x: number, y: number, z: number }
SignatureLua
getPlayerWantedCentrePosition(player: Player): Vector3

Usage

JavaScript
const { x, y, z } = getPlayerWantedCentrePosition(player);
Lua
local coords = getPlayerWantedCentrePosition(player)
-- coords.x, coords.y, coords.z

Parameters

ParameterTypeJavaScriptLua
playerPlayernumberinteger

Returns

Vector3 JavaScript { x: number, y: number, z: number }, Lua Vector3

A 3D vector. JavaScript gets a plain { x, y, z } object; Lua gets a real Vector3, with .x .y .z and arithmetic. As an argument, one vector fills three consecutive coordinates.

Reference

Namespace
Player PLAYER
In the game
Vector3 GET_PLAYER_WANTED_CENTRE_POSITION(Player player)
Hash
0x0C92BA89F1AF26F8

Open in the interactive natives reference