So, the script is working.
So it all works, just is still failing to fetch my ace permissions?
local allowedToUse = false
Citizen.CreateThread(function()
TriggerServerEvent("Roleplay-Menu.getIsAllowed")
end)
RegisterNetEvent("Roleplay-Menu.returnIsAllowed")
AddEventHandler("Roleplay-Menu.returnIsAllowed", function(isAllowed)
allowedToUse = isAllowed
end)
RegisterCommand('onduty', function(source, args, rawCommand)
if allowedToUse then
onduty = not onduty
local str = nil
if onduty then
str = "^2 onduty"
else
str = "^1 offduty"
end
TriggerEvent('chatMessage', "^1[SYSTEM]:^0 You are now"..str.."^0.")
else
TriggerEvent("chatMessage", "", {255,255,255}, "^1You're Not Authorised To Use This Command!")
end
end, true)