A marker need to be draw every frame, so Citizen.Wait(0) instead of Citizen.Wait(5), then DrawMarker need float not int (-984.0): doc . Samething for dirX… need to be like 0.0.
What is CheckPos ? Is exist in your resource?
Last thing, you forgot some " here: TriggerEvent(Respawn:Rewhateveritwas)
OK, so I altered a few things, the maker shows up, but I don’t get a notifications and I can’t trigger the event:
ESX = nil
Citizen.CreateThread(function()
while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.Wait(0)
end
end)
RegisterNetEvent('esx:playerLoaded')
AddEventHandler('esx:playerLoaded', function(xPlayer)
PlayerData = xPlayer
end)
function hintToDisplay(text)
SetTextComponentFormat("STRING")
AddTextComponentString(text)
DisplayHelpTextFromStringLabel(0, 0, 1, -1)
end
local place = {
{x = 895.39,y = -179.52,z = 73.7}
}
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
for k in pairs(place) do
DrawMarker(27, place[k].x, place[k].y, place[k].z, 0, 0, 0, 0, 0, 0, 1.001, 1.0001, 0.5001, 0, 255, 50, 200, 0, 0, 0, 0)
end
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
for k in pairs(place) do
local plyCoords = GetEntityCoords(GetPlayerPed(-1), false)
local dist = Vdist(plyCoords.x, plyCoords.y, plyCoords.z, place[k].x, place[k].y, place[k].z)
if dist <= 0.5 then
--doesnt spam notifcations only shows top corner
hintToDisplay('Press ~INPUT_CONTEXT~ to Respawn Character')
if IsControlJustPressed(0, 38) then -- "E"
TriggerEvent('respawn:RespawnCharacter')
end
end
end
end
end)