Jump to content

Error IsObjectInACLGroup


trux_yt

Recommended Posts

local function updateNametagColor( player )
	local nametagColor = { 127, 127, 127, priority = 100 }
	if p[ player ] and isLoggedIn( player ) then
		nametagColor = { 255, 255, 255, priority = 100 }
		if getOption( player, "staffduty" ) then
			for key, value in ipairs( groups ) do
				if isObjectInACLGroup( "user." .. p[ player ].username, aclGetGroup( value.aclGroup ) ) and value.nametagColor then --warn line
					if value.priority < nametagColor.priority then
						nametagColor = value.nametagColor
						nametagColor.priority = value.priority
					end
				end
			end
		elseif getOption( player, "vip" ) then
			nametagColor = { 224, 227, 20 }
			nametagColor.priority = 50
		end
	end
	setPlayerNametagColor( player, unpack( nametagColor ) )
end

Hi, i have this warn in the console, like a loop.

Bad argument @ 'isObjectInACLGroup' [Expected acl-group at argument 2, got boolean]

 

How i can solve this??

Link to comment

Hello, the error comes from aclGetGroup( value.aclGroup ) as it doesnt find the acl group and return false.

whats in the groups table you are looping through ? i guess acl groups but we cant see how you set the var, maybe the problem comes from that

Edited by Spakye
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...