Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local cooldown = 0
- local ispriority = false
- local ishold = false
- local activatorPlayerName = ""
- local availabledTime = 0
- -- Reset Clock
- RegisterCommand("resetpcd", function()
- TriggerServerEvent("cancelcooldown")
- end, false)
- RegisterNetEvent('UpdateCooldown')
- AddEventHandler('UpdateCooldown', function(newCooldown)
- cooldown = newCooldown
- end)
- RegisterNetEvent('UpdateAvailabledTime')
- AddEventHandler('UpdateAvailabledTime', function(newAvailabledTime)
- availabledTime = newAvailabledTime
- end)
- RegisterNetEvent('UpdateActivatorPlayerName')
- AddEventHandler('UpdateActivatorPlayerName', function(name)
- activatorPlayerName = name
- end)
- RegisterNetEvent('UpdatePriority')
- AddEventHandler('UpdatePriority', function(newispriority)
- ispriority = newispriority
- end)
- RegisterNetEvent('UpdateHold')
- AddEventHandler('UpdateHold', function(newishold)
- ishold = newishold
- end)
- Citizen.CreateThread(function()
- while true do
- Citizen.Wait(0)
- if ishold == true then
- DrawText2("~c~Priority: ~r~( Activated by " .. activatorPlayerName .. " )")
- elseif cooldown == 0 then
- if availabledTime >= 60 then
- local minutes = availabledTime / 60
- local seconds = availabledTime % 60
- DrawText2("~c~Priority: ~g~( Available " .. minutes .. " minutes " .. seconds .. " second")
- else
- DrawText2("~c~Priority: ~g~( Available " .. availabledTime .. " seconds)")
- end
- elseif ispriority == false then
- DrawText2("~c~Priority: ~r~".. cooldown .." ~w~Mins")
- elseif ispriority == true then
- DrawText2("~c~Priority: ~b~Priority In Progress")
- end
- end
- end)
- function DrawText2(text)
- SetTextFont(4)
- SetTextProportional(1)
- SetTextScale(0.1, 0.5)
- SetTextDropshadow(1, 0, 0, 0, 0)
- SetTextEdge(0, 0, 0, 0, 0)
- SetTextDropShadow()
- SetTextOutline()
- SetTextEntry("STRING")
- AddTextComponentString(text)
- DrawText(0.175, 0.850)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement