Giving specific users access to ulx commands without a group, but only a variable
3 replies, posted
Hey,
I would like to give users some ulx admin commands without their own group, but only a variable: Player.DarkRPVars.vip == true. I already tried editing their overwriting IsAdmin function, but no results.
I made a copy of the overwriting ulx IsAdmin function.
[code]
local origIsAdmin = meta.IsAdmin
--[[
Function: Player:IsAdmin
Overwrite garry's IsAdmin function to check for membership in admin group. This is so if group "serverowner"
inherits from superadmin, this function will still return true when checking on a member belonging to the
"serverowner" group.
Returns:
True is the user belongs in the admin group directly or indirectly, false otherwise.
Revisions:
v2.40 - Rewrite.
]]
function meta:IsAdmin()
if ucl.groups[ ULib.ACCESS_ADMIN ] then
return self:CheckGroup( ULib.ACCESS_ADMIN )
else -- Group doesn't exist, fall back on garry's method
origIsAdmin( self )
end
end
[/code]
I already tried this:
[code]
function meta:IsAdmin()
if self.DarkRPVars.vip == true then
return true
elseif ucl.groups[ ULib.ACCESS_ADMIN ] then
return self:CheckGroup( ULib.ACCESS_ADMIN )
else -- Group doesn't exist, fall back on garry's method
origIsAdmin( self )
end
end
[/code]
I would really be interested in this I am trying to do something similar
I have an IsVIP() function and I would like to allow VIPs the votekick and voteban commands without actually changing their ugroup.
Did you find a way to do this?
The only way to do it without a group would be to edit the ulx code and make all group/isadmin checks also check that variable.
My recommendation would be to create a vip group in ulx. Then have a script hook the player join event and check if the person is in the vip group, if not add them.
ulx userallow
Sorry, you need to Log In to post a reply to this thread.