So i’m trying to check if the player is on a marker placed on the ground. How would i do this? I tried IS_ENTITY_IN_AREA but I can’t really understand how the area is drawn out. Thanks
Run a loop checking if the player x, y, z is close to the x, y, z of the marker. I think the native is called vdist
or something like that.
This. For example:
local spots = {
{x = 1732.854, y = 3985.293, z = 31.978},
{x = 1422.370, y = 3850.956, z = 32.069},
{x = 1885.514, y = 3998.694, z = 31.8809}
}
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
local x,y,z = table.unpack(GetEntityCoords(GetPlayerPed(-1), true))
local distance
for k, coords in pairs(spots) do
distance = GetDistanceBetweenCoords(x, y, z, coords.x, coords.y, coords.z, true)
end
end
end)
1 Like