So I’m looking to make two markers. These both show when I’m really close to the coords as seen below:
but when I walk away, they disappear from view. Does anyone know why? I have seen on other servers markers can be seen from quite a distance. So unsure on what I’ve done wrong?
My code can be found below:
--local variables
local PedID = GetPlayerPed(-1)
--Functions Start
function healBlip()
local pMaxHealth = GetPedMaxHealth(PedID) -- This returns a value for the Players Max Health.
SetEntityHealth(PedID, pMaxHealth) -- This would then set the player health, to equal the max of their entity.
end
function ammoBlip()
local pMaxAmmoAmount = GetMaxAmmo(PedID, GetSelectedPedWeapon(PedID)) -- Looks at the playerPedID and the weapon they have equipped. Find the max ammo amount.
SetPedAmmo(PedID, GetSelectedPedWeapon(PedID), pMaxAmmoAmount) --This sets the ammo to be the max, depending on the weapon the ped is holding.
end
function notify(string)
BeginTextCommandThefeedPost("STRING")
AddTextComponentSubstringPlayerName(string)
EndTextCommandThefeedPostTicker(true, false)
end
--Functions End
healLocation = {
x = -2250.88,
y = 3137.78,
z = 31.81,
marker = 25,
scale = 1.0,
colour = {255,0,0,180}
}
ammoLocation = {
x = -2252.56,
y = 3135.12,
z = 31.81,
marker = 25,
scale = 1.0,
colour = {0,0,255,180}
}
--Loops below to ensure the markers load all the time, with the correct parameters.
Citizen.CreateThread(
function()
while true do
Citizen.Wait(0)
DrawMarker(
healLocation.marker,
healLocation.x,
healLocation.y,
healLocation.z,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
healLocation.scale,
healLocation.scale,
healLocation.scale,
healLocation.colour[1],
healLocation.colour[2],
healLocation.colour[3],
healLocation.colour[4],
false,
true,
2,
nil,
nil,
false
)
DrawMarker(
ammoLocation.marker,
ammoLocation.x,
ammoLocation.y,
ammoLocation.z,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
ammoLocation.scale,
ammoLocation.scale,
ammoLocation.scale,
ammoLocation.colour[1],
ammoLocation.colour[2],
ammoLocation.colour[3],
ammoLocation.colour[4],
false,
false,
2,
nil,
nil,
false
)
local playerCoord = GetEntityCoords(PedID, false)
local healthVector = vector3(healLocation.x, healLocation.y, healLocation.z)
local ammoVector = vector3(ammoLocation.x, ammoLocation.y, ammoLocation.z)
if Vdist2(playerCoord, healthVector) < healLocation.scale * 1.12 then
--Code that activates once within the marker's radius.
healBlip()
notify("You have been ~r~Healed~w~ to max health!")
elseif Vdist2(playerCoord, ammoVector) < ammoLocation.scale * 1.12 then
ammoBlip()
notify("Your ammo has been replenished!")
end
end
end
)
Thanks in advance,


)