Advertisement
Exho

gm_abandoned_fix

Jan 6th, 2015
437
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.56 KB | None | 0 0
  1. if SERVER then
  2.     --// gm_abanoned by Kit Kettle http://steamcommunity.com/sharedfiles/filedetails/?id=336232506
  3.    
  4.     print("// Loaded gm_abandoned fixer //")
  5.     local function fixStupid()
  6.         local mapName = "gm_abandoned"
  7.         local stupidTriggerName = "lights"
  8.         local stupidCount = 0
  9.         if string.sub( game.GetMap( ), 1, string.len(mapName) ) == mapName then
  10.             print("Nuking stupid ass entities")
  11.            
  12.             for k, ent in pairs( ents.GetAll() ) do
  13.                 local name = string.lower( ent:GetName() )
  14.                 local class = string.lower( ent:GetClass() )
  15.                 if class == "lua_run" or name == "disconnectcmd" or name == "limits" or name == "disablenoclip" then
  16.                     print("Got ourselves a lua_run")
  17.                     ent:Remove()
  18.                     stupidCount = stupidCount + 1
  19.                 elseif class == "logic_timer" then
  20.                     print("Whats this? A logic_timer!")
  21.                     ent:Remove()
  22.                     stupidCount = stupidCount + 1
  23.                 elseif class == "point_clientcommand" or class == "point_servercommand" then
  24.                     print("No console commands will ever be run")
  25.                     ent:Remove()
  26.                     stupidCount = stupidCount + 1
  27.                 elseif string.sub( name, 1, string.len(stupidTriggerName)) == stupidTriggerName then
  28.                     print("Triggers that 'keep' you in the map? NOPE")
  29.                     ent:Remove()
  30.                     stupidCount = stupidCount + 1
  31.                 end
  32.             end
  33.             PrintMessage( HUD_PRINTTALK, "*Beep boop* Deleted "..stupidCount.." stupid entities by Kit Kettle, remember to tip your waiter")
  34.         end
  35.     end
  36.    
  37.     hook.Add("InitPostEntity", "gm_abandoned_fix", function()
  38.         fixStupid()
  39.     end)
  40.    
  41.     concommand.Add("gm_abandoned_fix", function()
  42.         fixStupid()
  43.     end)
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement