Jump to content

How do I get the players current acl groups?


Adde

Recommended Posts

Hello, I am working on a staff/admin panel and I have searched and searched to find how I can see the players current acl groups but I can´t find it. So now I have to ask you guys. Will be thankfull If someone knows how to do that :)
        local account = getPlayerAccount(source)  
  
        local accname = getAccountName(account)  
  
        if isObjectInACLGroup("user."..accname,aclGetGroup("Group Name")) then 

Link to comment
Hello, I am working on a staff/admin panel and I have searched and searched to find how I can see the players current acl groups but I can´t find it. So now I have to ask you guys. Will be thankfull If someone knows how to do that :)
        local account = getPlayerAccount(source)  
  
        local accname = getAccountName(account)  
  
        if isObjectInACLGroup("user."..accname,aclGetGroup("Group Name")) then 

Current acl groups. Not see if the player is in that acl group. I mean kinda create a table with all acl groups that the player is in. Like in the info line in admin panel where you can see example: "Groups: Admin, VIP, Everyone".

Or am I supposed to use that and if the player is in that group then add groupname to the info line?

Link to comment
function aclGetAccountGroups ( account ) 
    local acc = getAccountName ( account ) 
    if ( not acc ) then return false end 
    local res = {} 
    acc = "user."..acc 
    local all = "user.*" 
    for ig, group in ipairs ( aclGroupList() ) do 
        for io, object in ipairs ( aclGroupListObjects ( group ) ) do 
            if ( ( acc == object ) or ( all == object ) ) then 
                table.insert ( res, aclGroupGetName ( group ) ) 
                break 
            end 
        end 
    end 
    return res 
end 

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