SetPlayerWantedCentrePosition
Docslocal position = SetPlayerWantedCentrePosition(player, p2, p3)Description
# Predominant call signatures
PLAYER::SET_PLAYER_WANTED_CENTRE_POSITION(PLAYER::PLAYER_ID(), ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), 1));
# Parameter value ranges
P0: PLAYER::PLAYER_ID()
P1: ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), 1)
P2: Not set by any callParameters
| Name | Type | Description |
|---|---|---|
player | Player | — |
position | Vector3* | — |
p2 | BOOL | — |
p3 | BOOL | — |
Quick Snippet: Get Coordinatesposition
positionAdd this command to your client script to retrieve precise locations in-game.
-- Add this to your client.lua. Type /pos in-game to copy coords.
RegisterCommand('pos', function()
local ped = PlayerPedId()
local coords = GetEntityCoords(ped)
local heading = GetEntityHeading(ped)
local output = string.format("vector4(%.2f, %.2f, %.2f, %.2f)", coords.x, coords.y, coords.z, heading)
print(output)
TriggerEvent('chat:addMessage', { args = { '^4[COORD]^0', output } })
end)Quick Snippet: Get Playerplayer
playerUse this to get the local player ID or a target player's server ID.
-- Get the local player index (client-side)
local playerId = PlayerId()
-- Get the local player's server ID (for server events)
local serverId = GetPlayerServerId(playerId)
print("Player ID: " .. playerId)
print("Server ID: " .. serverId)
-- Get player ped from a server ID:
-- local targetPed = GetPlayerPed(GetPlayerFromServerId(targetServerId))Returns
voidThis native does not return a value.