ULX

Author Topic: Remove User  (Read 3799 times)

0 Members and 1 Guest are viewing this topic.

Offline cold12141

  • Newbie
  • *
  • Posts: 14
  • Karma: 0
Remove User
« on: May 09, 2007, 05:28:20 PM »
Much like adduser but, as you probably already figured out, it removes said player from whatever position of power he had.

Offline Neico

  • Newbie
  • *
  • Posts: 13
  • Karma: 4
    • Neic0.de
Re: Remove User
« Reply #1 on: August 07, 2007, 10:19:37 PM »
try this one just add it into a file (i called it "ulx_removeuser.lua") and put this file into ULib/modules/
have fun :D (oh its not tested so if it works reply i want to know if it works :D)
Code: [Select]
if !ulx then return end
function ulx.cc_removeuser( ply, command, argv, args )
if #argv < 2 then
if #argv ~= 0 then
ULib.tsay( ply, ulx.LOW_ARGS )
else
ULib.console( ply, "ulx removeuser <user>" )
ULib.console( ply, "user - The user to remove" )
ULib.console( ply, "This user WILL be removed to the permanent users list!" )
end
return
end

local target, err = ULib.getUser( argv[ 1 ], _, ply )
if not target then
ULib.tsay( ply, err )
return
end

if target:IsUserGroup( ULib.ACCESS_SUPERADMIN ) and ply:IsValid() and not ply:IsListenServerHost() then
ULib.tsay( ply, "Sorry, for security reasons, you can't change the access of a superadmin!" )
return
end

local info = ULib.ucl.authed[ target ]
if info.type == "guest" or info.type == "listen host" then
ULib.ucl.removeUser( target:Nick(), true )
else
ULib.ucl.removeUser( info.account, true )
end
ulx.logUserAct( ply, target, "#A removed user #T from group \"" .. group .. "\"" )
end
ulx.concommand( "removeuser", ulx.cc_removeuser, "<user> - Use with no args for more help.", ULib.ACCESS_SUPERADMIN, _, _, ulx.ID_PLAYER_HELP )

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Remove User
« Reply #2 on: August 07, 2007, 10:20:43 PM »
Giving it a quick look-over, it appears it will work. Good work Neico!
Experiencing God's grace one day at a time.