Jump to content

aclGetGroup does NOT work


Recommended Posts

I do not understand why these lines do not work.

Debugscript 3 says:

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

How? The second argument is aclGetGroup ("Admin"), so why doesn't it work?

function ACLCheck(player, command) 
  
    local account = getAccountName(getPlayerAccount(player)) 
    local arena = getElementData(player, "Arena") 
     
    if isObjectInACLGroup ( "user." .. account, aclGetGroup("Admin")) then --bugged 
        return true 
    end 
------------- 
end 

I tried to output account and tostring(account), BOTH worked. I tried to output "Awesome" if I got the Admin ACL Group, and guess what?

if not aclGetGroup("Admin") then outputChatBox("Awesome") 

This worked, so the script does not receive the acl group. WHY?

PD: and yes, the Admin group exists. I even tried with Console group, too.

Link to comment
I tried to output "Awesome" if I got the Admin ACL Group, and guess what?
if not aclGetGroup("Admin") then outputChatBox("Awesome") 

That code will output 'Awesome' if the ACL group does not exist. You used 'if not aclGetGroup("Admin")'.

outputDebugString("Does 'Admin' group exist? "..tostring(aclGetGroup("Admin"))) 

If it outputs false or nil, it doesn't exist. If it outputs something like 'userdata', it's an ACL group.

Link to comment
I tried to output "Awesome" if I got the Admin ACL Group, and guess what?
if not aclGetGroup("Admin") then outputChatBox("Awesome") 

That code will output 'Awesome' if the ACL group does not exist. You used 'if not aclGetGroup("Admin")'.

outputDebugString("Does 'Admin' group exist? "..tostring(aclGetGroup("Admin"))) 

If it outputs false or nil, it doesn't exist. If it outputs something like 'userdata', it's an ACL group.

Thanks, I found out the group Admin didn't exist. And then I added it via the admin panel, and I searched a bit and found out that I was using a file called "editor_acl", because I was testing out with the MTA Editor.

Is this normal or it must be changed? Will it use the normal acl if I start MTA Server.exe?

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...