Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2014
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. AddCSLuaFile()
  2.  
  3. if SERVER then
  4. hook.Add("PlayerSay", "purge", function(ply,text)
  5. if ply:IsAdmin() or ply:IsSuperAdmin() then
  6. local t=string.Explode(" ", text)
  7. if t and t[1] then
  8. local cmd=t[1]:lower()
  9. if cmd=="!purge" then
  10. ply:ConCommand("purge")
  11. return ""
  12. end
  13. end
  14. end
  15. end)
  16. elseif CLIENT then
  17. local purge=false
  18. local purgeending=false
  19. concommand.Add( "purge", function()
  20. if not (LocalPlayer():IsAdmin() or LocalPlayer():IsSuperAdmin()) then return end
  21. if purge and not purgeending then
  22. hook.Add("HUDPaint", "purge", function()
  23. draw.SimpleText("Purge has now ended", "CloseCaption_Bold", ScrW()-130, ScrH()/14, Color(255,255,255,200), TEXT_ALIGN_CENTER)
  24. end)
  25. LocalPlayer():EmitSound("paft/end.wav")
  26. timer.Simple(10,function()
  27. hook.Remove("HUDPaint", "purge")
  28. purgeending=false
  29. purge=false
  30. end)
  31. purgeending=true
  32. elseif not purge then
  33. hook.Add("HUDPaint", "purge", function()
  34. draw.SimpleText("Purge Is Active", "CloseCaption_Bold", ScrW()-130, ScrH()/14, Color(255,255,255,200), TEXT_ALIGN_CENTER)
  35. end)
  36. LocalPlayer():EmitSound("paft/start.wav")
  37. purge=true
  38. end
  39. end)
  40. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement