Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,17 @@ end
local function setWaypoint()
if not isJobValid(PlayerData.job.type) then return end
if not IsOnDuty() then return end

local data = lib.callback.await('ps-dispatch:callback:getLatestDispatch', false)

if not data then return end

if data.alertTime == nil then data.alertTime = Config.AlertTime end

if data.time < GetGameTimer() * 1000 then return end

local timer = data.alertTime * 1000

if not waypointCooldown and lib.table.contains(data.jobs, PlayerData.job.type) then
SetNewWaypoint(data.coords.x, data.coords.y)
TriggerServerEvent('ps-dispatch:server:attach', data.id, PlayerData)
Expand Down