Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. -- Made for pure 31/10/14 to ban people from being deaths in death run, untested and probably shit
  2.  
  3. --add in line 38 of sv_round.lua from death run
  4.  
  5. --******and not v.BannedDeath*****
  6.  
  7. --Then maybe just make a serverside lua file and paste this shit in it
  8.  
  9. --Ban command
  10. concommand.Add("BanDeath", function(ply,cmd,args)
  11. if not (ply:IsAdmin() or ply:IsSuperAdmin()) then
  12. ply:ChatPrint("You're not an admin!\n")
  13. return
  14. end
  15. if not args[1] then
  16. ply:ChatPrint("You didn't provide a player's name!\n")
  17. return
  18. end
  19. local ply2
  20. for k,v in pairs(player.GetAll()) do
  21. if v:Nick() == args[1] then
  22. ply2 = v
  23. break
  24. end
  25. end
  26. if not ply2 then
  27. ply:ChatPrint("No player was found by the name of" ..args[1].."!\n")
  28. return
  29. end
  30. ply2:SetPData("DeathBanned",true)
  31. ply2.BannedDeath = true
  32. if ply2:Team() == TEAM_RUNNER then ply2:Kill() ply2:SetTeam(TEAM_SPECTATOR) end
  33. end)
  34.  
  35. --With a function to load whether a player is spawned on initial spawned
  36.  
  37. hook.Add("PlayerInitialSpawn", "IsPlayerDeathBanned", function(ply)
  38. ply.BannedDeath = ply:GetPData("DeathBanned")
  39. end)
  40.  
  41. --A command to unband
  42.  
  43. concommand.Add("UnBanDeath", function(ply,cmd,args)
  44. if not (ply:IsAdmin() or ply:IsSuperAdmin()) then
  45. ply:ChatPrint("You're not an admin!\n")
  46. return
  47. end
  48. if not args[1] then
  49. ply:ChatPrint("You didn't provide a player's name!\n")
  50. return
  51. end
  52. local ply2
  53. for k,v in pairs(player.GetAll()) do
  54. if v:Nick() == args[1] then
  55. ply2 = v
  56. break
  57. end
  58. end
  59. if not ply2 then
  60. ply:ChatPrint("No player was found by the name of" ..args[1].."!\n")
  61. return
  62. end
  63. if not ply2.BannedDeath then
  64. ply:ChatPrint("That player isn't banned from being death!\n")
  65. return
  66. end
  67. ply2:SetPData("DeathBanned",false)
  68. ply2.BannedDeath = false
  69. end)
  70.  
  71. -- and one to check who's banned in the server
  72.  
  73. concommand.Add("DeathBans", function(ply,cmd,args)
  74. if not (ply:IsAdmin() or ply:IsSuperAdmin()) then
  75. ply:ChatPrint("You're not an admin!\n")
  76. return
  77. end
  78. local found
  79. for k,v in pairs(player.GetAll()) do
  80. if v.BannedDeath then
  81. found = true
  82. ply:ChatPrint(v:Nick())
  83. end
  84. end
  85. if not found then
  86. ply:ChatPrint("No one is currently banned from being death in the server.\n")
  87. return
  88. end
  89. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement