Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local allowedToUse = false
- Citizen.CreateThread(function()
- TriggerServerEvent("Roleplay-Menu.getIsAllowed")
- end)
- RegisterNetEvent("Roleplay-Menu.returnIsAllowed")
- AddEventHandler("Roleplay-Menu.returnIsAllowed", function(isAllowed)
- allowedToUse = isAllowed
- end)
- -- In your resource, check "allowedToUse" whenever you want to "do" something that needs permissions, for example
- if allowedToUse then
- RegisterCommand('onduty', function()
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement