Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Made for pure 31/10/14 to ban people from being deaths in death run, untested and probably shit
- --add in line 38 of sv_round.lua from death run
- --******and not v.BannedDeath*****
- --Then maybe just make a serverside lua file and paste this shit in it
- --Ban command
- concommand.Add("BanDeath", function(ply,cmd,args)
- if not (ply:IsAdmin() or ply:IsSuperAdmin()) then
- ply:ChatPrint("You're not an admin!\n")
- return
- end
- if not args[1] then
- ply:ChatPrint("You didn't provide a player's name!\n")
- return
- end
- local ply2
- for k,v in pairs(player.GetAll()) do
- if v:Nick() == args[1] then
- ply2 = v
- break
- end
- end
- if not ply2 then
- ply:ChatPrint("No player was found by the name of" ..args[1].."!\n")
- return
- end
- ply2:SetPData("DeathBanned",true)
- ply2.BannedDeath = true
- if ply2:Team() == TEAM_RUNNER then ply2:Kill() ply2:SetTeam(TEAM_SPECTATOR) end
- end)
- --With a function to load whether a player is spawned on initial spawned
- hook.Add("PlayerInitialSpawn", "IsPlayerDeathBanned", function(ply)
- ply.BannedDeath = ply:GetPData("DeathBanned")
- end)
- --A command to unband
- concommand.Add("UnBanDeath", function(ply,cmd,args)
- if not (ply:IsAdmin() or ply:IsSuperAdmin()) then
- ply:ChatPrint("You're not an admin!\n")
- return
- end
- if not args[1] then
- ply:ChatPrint("You didn't provide a player's name!\n")
- return
- end
- local ply2
- for k,v in pairs(player.GetAll()) do
- if v:Nick() == args[1] then
- ply2 = v
- break
- end
- end
- if not ply2 then
- ply:ChatPrint("No player was found by the name of" ..args[1].."!\n")
- return
- end
- if not ply2.BannedDeath then
- ply:ChatPrint("That player isn't banned from being death!\n")
- return
- end
- ply2:SetPData("DeathBanned",false)
- ply2.BannedDeath = false
- end)
- -- and one to check who's banned in the server
- concommand.Add("DeathBans", function(ply,cmd,args)
- if not (ply:IsAdmin() or ply:IsSuperAdmin()) then
- ply:ChatPrint("You're not an admin!\n")
- return
- end
- local found
- for k,v in pairs(player.GetAll()) do
- if v.DeathBanned then
- found = true
- ply:ChatPrint(v:Nick())
- end
- end
- if not found then
- ply:ChatPrint("No one is currently banned from being death in the server.\n")
- return
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement