Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.08 KB | None | 0 0
  1. local cooldown = 0
  2. local ispriority = false
  3. local ishold = false
  4. local activatorPlayerName = ""
  5. local availabledTime = 0
  6.  
  7. -- Reset Clock
  8. RegisterCommand("resetpcd", function()
  9.     TriggerServerEvent("cancelcooldown")
  10. end, false)
  11.  
  12. RegisterNetEvent('UpdateCooldown')
  13. AddEventHandler('UpdateCooldown', function(newCooldown)
  14.     cooldown = newCooldown
  15. end)
  16.  
  17. RegisterNetEvent('UpdateAvailabledTime')
  18. AddEventHandler('UpdateAvailabledTime', function(newAvailabledTime)
  19.     availabledTime = newAvailabledTime
  20. end)
  21.  
  22. RegisterNetEvent('UpdateActivatorPlayerName')
  23. AddEventHandler('UpdateActivatorPlayerName', function(name)
  24.     activatorPlayerName = name
  25. end)
  26.  
  27. RegisterNetEvent('UpdatePriority')
  28. AddEventHandler('UpdatePriority', function(newispriority)
  29.     ispriority = newispriority
  30. end)
  31.  
  32. RegisterNetEvent('UpdateHold')
  33. AddEventHandler('UpdateHold', function(newishold)
  34.     ishold = newishold
  35. end)
  36.  
  37. Citizen.CreateThread(function()
  38.  
  39.     while true do
  40.  
  41.         Citizen.Wait(0)
  42.  
  43.         if ishold == true then
  44.  
  45.             DrawText2("~c~Priority: ~r~( Activated by " .. activatorPlayerName .. " )")
  46.  
  47.         elseif cooldown == 0 then
  48.  
  49.             if availabledTime >= 60 then
  50.                 local minutes = availabledTime / 60
  51.                 local seconds = availabledTime % 60
  52.                 DrawText2("~c~Priority: ~g~( Available " .. minutes .. " minutes " .. seconds .. " second")
  53.             else
  54.                 DrawText2("~c~Priority: ~g~( Available " .. availabledTime .. " seconds)")
  55.             end
  56.  
  57.  
  58.         elseif ispriority == false then
  59.  
  60.             DrawText2("~c~Priority: ~r~".. cooldown .." ~w~Mins")
  61.  
  62.         elseif ispriority == true then
  63.  
  64.             DrawText2("~c~Priority: ~b~Priority In Progress")
  65.  
  66.         end
  67.  
  68.     end
  69.  
  70. end)
  71.  
  72.  
  73.  
  74.     function DrawText2(text)
  75.  
  76.         SetTextFont(4)
  77.  
  78.         SetTextProportional(1)
  79.  
  80.         SetTextScale(0.1, 0.5)
  81.  
  82.         SetTextDropshadow(1, 0, 0, 0, 0)
  83.  
  84.         SetTextEdge(0, 0, 0, 0, 0)
  85.  
  86.         SetTextDropShadow()
  87.  
  88.         SetTextOutline()
  89.  
  90.         SetTextEntry("STRING")
  91.  
  92.         AddTextComponentString(text)
  93.  
  94.         DrawText(0.175, 0.850)
  95.  
  96.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement