Ok, so I was trying to make a command like !respected to promote someone to that rank, it worked however I cannot make an opposite of this command - it just wont work here it is:
function ulx.addrespected( calling_ply, target_ply, should_unrespected )
local userInfo = ULib.ucl.authed[ target_ply:UniqueID() ]
local id = ULib.ucl.getUserRegisteredID( target_ply )
if not id then id = target_ply:SteamID() end
if not should_unrespected then
ULib.ucl.addUser( id, userInfo.allow, userInfo.deny, "respected")
elseif target_ply:IsUserGroup("respected") then
ULib.ucl.removeUser( target_ply:UniqueID() )
end
if not should_unrespected then
ulx.fancyLogAdmin( calling_ply, "#A has promoted #T to Respected! Congratulations #T", target_ply, target_ply )
else
ulx.fancyLogAdmin( calling_ply, "#A has demoted #T from Respected! Unlucky #T", target_ply, target_ply )
end
end
local addrespected = ulx.command( CATEGORY_NAME, "ulx respected", ulx.addrespected, "!respected" )
addrespected:addParam{ type=ULib.cmds.PlayerArg, target="!^" }
addrespected:defaultAccess( ULib.ACCESS_ADMIN )
addrespected:help( "Promote player to rank Respected, DO NOT ABUSE." )
addrespected:setOpposite( "ulx unrespected", {_, _, true}, "!unrespected" )
I don't know whats the deal with it, but whenever I called ulx unrespected - it promotes them to respected, any ideas?