GetPosAlongGpsTypeRoute
Docslocal retval, result = GetPosAlongGpsTypeRoute(bStartAtPlayerPos, fDistanceAlongRoute, slotType)Description
Native to get a position along current player GPS route using supplied slot.
This native was previously named GET_GPS_WAYPOINT_ROUTE_END, but its named changed.
enum eGpsSlotType {
GPS_SLOT_WAYPOINT = 0,
GPS_SLOT_RADAR_BLIP = 1,
GPS_SLOT_DISCRETE = 2
}Parameters
| Name | Type | Description |
|---|---|---|
result | Vector3* | Coordinates of waypoint marker |
bStartAtPlayerPos | BOOL | Should we project distance from the player position or from next node. |
fDistanceAlongRoute | float | Distance we want to get the position along the route. |
slotType | int | Type of gps route to check against. See `eGpsSlotType`. |
Quick Snippet: Get Coordinatesresult
resultAdd 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)Returns
BOOLReturns TRUE (1) or FALSE (0).