Jump to content

ACL access


dewu

Recommended Posts

Hi guys.

Im looking for a way to set some player access, to adding other players into his ACL Group.

Example:

Only Player1 can add other players to Group1, by use command /add OtherPlayer.

I create own script, but don't know why it's not working ;/

  
function test1 (playerSource, commandName, accountName) 
    if isObjectInACLGroup ("user.dewu", aclGetGroup ( "Group1" ) ) then 
      if accountName then  
        aclGroupAddObject (aclGetGroup("Group1"), "user."..accountName) 
        outputChatBox ("Account '"..accountName.."' succesfully added to the group.", playerSource) 
    else  
        outputChatBox ("No account name specified.", playerSource) 
    end 
end 
end 
  
addCommandHandler ("add", test1) 
  

Link to comment
local users = {} 
local aclObjects = aclGroupListObjects(aclGetGroup("admin")) 
for k,v in ipairs(aclObjects) do 
    local table = string.split(v, ".") 
    if table[1] == "user" then 
        table.insert(users, table[2]) 
    end 
end 

Table "users" will contain each username in a format like

{"bobby","joe","EdibleSpoon44"} 

Which you can iterate through with an ipairs loop.

Link to comment
One more good way:
  
local users = {} 
local aclObjects = aclGroupListObjects(aclGetGroup("admin")) 
for k,v in ipairs(aclObjects) do 
     table.insert(users, string.gsub(v, "user.", "") 
end 
  

The only issue is that the table aclObjects will contain more than just players.

Link to comment
  • 3 months later...

Guys, i need your help again. I've got two scripts:

 function test1 (playerSource, commandName, accountName) 
    if isObjectInACLGroup ("user.dewu", aclGetGroup ( "Group1" ) ) then 
      if accountName then  
        aclGroupAddObject (aclGetGroup("Group1"), "user."..accountName) 
        outputChatBox ("Account '"..accountName.."' succesfully added to the group.", playerSource) 
    else  
        outputChatBox ("No account name specified.", playerSource) 
    end 
end 
end 
  
addCommandHandler ("add", test1) 

and

  
function test2 (playerSource, commandName, accountName) 
    if isObjectInACLGroup ("user.master", aclGetGroup ( "Group2" ) ) then 
      if accountName then  
        aclGroupAddObject (aclGetGroup("Group2"), "user."..accountName) 
        outputChatBox ("Account '"..accountName.."' succesfully added to the group.", playerSource) 
    else  
        outputChatBox ("No account name specified.", playerSource) 
    end 
end 
end 
  
addCommandHandler ("add", test2) 

When I try to add some user to Group1 logged as dewu then it'll add some user to both groups (Group1 and Group2).

I want to set dewu permission to add only to Group1,

and for master set permission to add only to Group2.

How to do that? ;/ I've tried everything. Or maybe is other, simplier way to got that?

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