mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-17 05:56:02 +01:00
Fix toggleDuty() for ESX
This commit is contained in:
@@ -117,7 +117,6 @@ function onResourceStart(func, thisScript)
|
|||||||
debugPrint("^6Bridge^7: ^2Shared Load Detected^7.")
|
debugPrint("^6Bridge^7: ^2Shared Load Detected^7.")
|
||||||
hasPrinted = true
|
hasPrinted = true
|
||||||
end
|
end
|
||||||
if isStarted(ESXExport) then Wait(10000) end
|
|
||||||
func()
|
func()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -104,16 +104,31 @@ function toggleDuty()
|
|||||||
TriggerServerEvent("QBCore:ToggleDuty")
|
TriggerServerEvent("QBCore:ToggleDuty")
|
||||||
Wait(100)
|
Wait(100)
|
||||||
onDuty = getPlayer().onDuty
|
onDuty = getPlayer().onDuty
|
||||||
|
|
||||||
elseif isStarted(RSGExport) then
|
elseif isStarted(RSGExport) then
|
||||||
TriggerServerEvent("RSGCore:ToggleDuty")
|
TriggerServerEvent("RSGCore:ToggleDuty")
|
||||||
Wait(100)
|
Wait(100)
|
||||||
onDuty = getPlayer().onDuty
|
onDuty = getPlayer().onDuty
|
||||||
else
|
|
||||||
|
elseif isStarted(ESXExport) then
|
||||||
|
local tempJob = ESX.GetPlayerData().job
|
||||||
|
tempJob.onDuty = not onDuty
|
||||||
|
ESX.SetPlayerData("job", tempJob)
|
||||||
|
onDuty = getPlayer().onDuty
|
||||||
if onDuty then
|
if onDuty then
|
||||||
triggerNotify(nil, "Now on duty", "success")
|
triggerNotify(nil, "Now on duty", "success")
|
||||||
else
|
else
|
||||||
triggerNotify(nil, "Now off duty", "success")
|
triggerNotify(nil, "Now off duty", "success")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
else
|
||||||
|
onDuty = not onDuty
|
||||||
|
if onDuty then
|
||||||
|
triggerNotify(nil, "Now on duty", "success")
|
||||||
|
else
|
||||||
|
triggerNotify(nil, "Now off duty", "success")
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user