I believe my issue is simple and maybe just a typo at this point, am just hoping someone can spot an error to help me get the below working. I am not recieving any errors at this point, nor any of the traces, and yes the files are loaded in __resource.lua.
Running timer on server then sending to all clients a random set of coords to be marked on map and route drawn.
server.lua
local playerslist = {}
local clockcount = 0
local blips = {
{id=153, x=-246.511 , y=6331.07 , z=32.4262},
{id=153, x=1826.7 , y=3693.3 , z=34.2242},
{id=153, x=-664.961 , y=308.31 , z=83.0841},
{id=153, x=-874.672 , y=-306.777 , z=39.5658},
{id=153, x=293.059 , y=-584.493 , z=43.1915},
{id=153, x=405.394 , y=-1420.13 , z=29.4453},
{id=153, x=1106.35 , y=-1477.55 , z=34.6925},
{id=153, x=-347.167 , y=-362.721 , z=31.5574},
{id=153, x=1640.1759 , y=2528.6689 , z=45.56486},
{id=153, x=-473.026 , y=-338.344 , z=35.202},
}
Citizen.CreateThread(function()
while true do
Citizen.Wait(1)
clockcount = clockcount + 1
if clockcount == 3000 then
Citizen.Trace("New LOC"..clockcount)
--anotherloc = TriggerEvent("zDays:sendloc")
outbreakloc = blips[math.random(1,#blips)]
TriggerClientEvent('zDays:getloc', -1, outbreakloc)
clockcount = 0
end
end
end)
client.lua
local playerslist = {}
local bliplist = {}
RegisterNetEvent("zDays:getloc")
AddEventHandler("zDays:getloc", function(loc)
--local X, Y, Z = table.unpack(GetEntityCoords(PlayerPedId(), true))TriggerServerEvent("zDays:sendloc")
outbreakloc = loc
for blips in pairs(bliplist) do
RemoveBlip(blips)
end
bliplist = {}
setloc(outbreakloc)
Citizen.Trace("Tracking LOC#" ..outbreakloc.."")
end)
function setloc(loc)
hotloc.x, hotloc.y, hotloc.z = table.unpack(loc)
hotzone = AddBlipForRadius(hotloc.x, hotloc.y, hotloc.z, 200.0)
SetBlipColour(hotzone, 1)
SetBlipAlpha(hotzone, 100)
SetBlipRoute(hotzone, true)
if not has_value(bliplist, hotzone) then
table.insert(bliplist, hotzone)
Citizen.Trace("New LOC#" ..hotzone.."")
--else
end
end