Aphex
April 30, 2018, 11:23am
1
No idea why the drug locations are not showing up on map. I copied the whole esx_drugs folder from another server and it still isn’t working… All I want is for the blips to show up.
Here is my config.lua:
https://pastebin.com/xPQMJ6aB
Here is my esx_drugs_cl.lua (the code is above – render markers where it should be):
https://pastebin.com/BBirUce0
-No errors in-game either. I’m a miner and the blip on the map still isn’t showing. Not even for weed locations… Weird?
Ask for help in the original post for the esx drugs resource. In fact, one of the comments in the release thread tells you exactly how to add blips.
For anybody wanting blips on the map…
Inside of esx_drugs_cl.lua add this above
– Render markers
-- Create Blips
Citizen.CreateThread(function()
for i=1, #Config.Map, 1 do
local blip = AddBlipForCoord(Config.Map[i].x, Config.Map[i].y, Config.Map[i].z)
SetBlipSprite (blip, Config.Map[i].id)
SetBlipDisplay(blip, 4)
SetBlipColour (blip, Config.Map[i].color)
SetBlipScale (blip, Config.Map[i].scale)
SetBlipAsShortRange(blip, true)
BeginTextCommandSetBlipName("STRING")
AddTe…
Aphex
April 30, 2018, 11:48am
3
This is what I have and its above render markers look:
-- Create Blips
Citizen.CreateThread(function()
for i=1, #Config.Map, 1 do
local blip = AddBlipForCoord(Config.Map[i].x, Config.Map[i].y, Config.Map[i].z)
SetBlipSprite (blip, Config.Map[i].id)
SetBlipDisplay(blip, 4)
SetBlipColour (blip, Config.Map[i].color)
SetBlipScale (blip, Config.Map[i].scale)
SetBlipAsShortRange(blip, true)
BeginTextCommandSetBlipName("STRING")
AddTextComponentString(Config.Map[i].name)
EndTextCommandSetBlipName(blip)
end
end)
-- Render markers
Citizen.CreateThread(function()
while true do
Wait(0)
local coords = GetEntityCoords(GetPlayerPed(-1))
for k,v in pairs(Config.Zones) do
if(GetDistanceBetweenCoords(coords, v.x, v.y, v.z, true) < Config.DrawDistance) then
DrawMarker(Config.MarkerType, v.x, v.y, v.z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.ZoneSize.x, Config.ZoneSize.y, Config.ZoneSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false)
end
end
end
end)
Then I also have config.lua set up correctly as shown on pastebin.
Aphex
April 30, 2018, 11:54am
4
When I login after adding what you posted, here’s the map:
I’m quite positive it would work if I ran it off my local computer tbh. Since I used zap-hosting there has been nothing but problems and the code to add map blips should definitely be working.
Please ask in the original resource topic. This way we can prevent the forum from getting cluttered with small questions about x resources.
Also, the topic will serve as a central place for answers, so questions that have been answered will not be asked over and over again.
Thank you for your understanding!