Ulysses Stuff > Releases for ULX v1.*
ULX Unban
JamminR:
From a post made in General Help and Support, I realised ULX 1.13 had no 'unban' command.
Either place the following code into a file such as gmod9/lua/ulx/modules/ulx_unban.lua (Recommended)
or, place this in your gmod9/lua/ulx/ulx_utils.lua file (NOT recommended, ULX v1 updates/re-installs would overwrite)
--- Code: ----- cc_ulxUnBan - responds to ulx_unban <user> or <steamid>, unbans the specified player/steamid
function cc_ulxUnBan( userid, args, argv, argc )
if argv[1] == nil then
return
end
if (string.find (argv[ 1 ],"STEAM",1,true) ~= nil) then
local unbanid = argv[1]
end
if unbanid == nil then
local target = getUser( userid, argv[1] )
if target == nil then -- something really went wrong. Panic out.
_PrintMessage(userid, HUD_PRINTCONSOLE, "Incorrect user or parameters. Make sure proper user, or STEAM is all caps.")
return
else
if _PlayerInfo( target, "connected" ) then
_ServerCommand( "removeid " .. _PlayerInfo( target, "networkid" ) .. ";writeid\n" )
ulx_log( "Admin " .. ulx_playerString( userid ) .. " unbanned player " .. ulx_playerString( target ) )
end
end
else
_ServerCommand( "removeid " .. unbanid .. ";writeid\n" )
ulx_log( "Admin " .. ulx_playerString( userid ) .. " unbanned steamid " .. ulx_playerString( unbanid ) )
end
end
ULX_CONCOMMAND( "ulx_unban", cc_ulxUnBan, ACCESS_BAN, "[user] or [STEAM:ID:BLAH] - unbans the specified player ", 1, "!unban" )
--- End code ---
If the person isn't currently on your server (either you've kicked or they've left), you MUST know the SteamID of the user to remove.
Change the 'ACCESS_BAN' in the last line to something requiring higher access if you want.
This is untested code. Let me know if it doesn't work. Please, not "This doesn't work"
Let me know exact errors/details if any.
Edit 1: Removed ulx_PlayerString per Megiddo's reply. Thanks!
Megiddo:
Very good!
One thing I noticed, though, you need to remove ulx_playerString() from "_ServerCommand( "removeid " .. ulx_playerString( unbanid ) .. ";writeid\n" )". ulx_playerString is used for logging, it won't work on commands.
JINX:
this is the last thing i want,when i have a deathmatcher in the server ive got ban,and i use it without hesitation
JamminR:
Heh, I'm pretty much the same way, but I've seen one or two here, and one or two in FP forums, ask how to unban using ULX, so I threw it together.
As for DMers, why don't you "gm_sv_pvpdamage 0" in your server.cfg?
This still allows player damage (I forget, gm_sv_playerdamage I think) for self mutilation/builds to kill, etc, but doesn't allow other players to use weapons/projectiles to cause damage.
The Jeff:
For me it doesnt work, I type the steam id perfectly, and it doesnt unban. could you please tell me how to unban the manuel way?
Navigation
[0] Message Index
[#] Next page
Go to full version