_NETWORK_GET_PLAYER_COORDS
Docslocal retval = NetworkGetPlayerCoords(player)Description
Returns the coordinates of another player.
Does not work if you enter your own player id as p0 (will return (0.0, 0.0, 0.0) in that case).
Parameters
| Name | Type | Description |
|---|---|---|
player | Player | The player id, MUST be another player. |
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
Vector3Returns a 3D vector (x, y, z).