Jump to content

command for add user in acl group


Recommended Posts

Why are not you working?

Command:

  
function delbase (playerSource, commandName, accountName) 
    local accName = getAccountName ( getPlayerAccount ( playerSource ) ) 
    if isObjectInACLGroup ("user."..accName, aclGetGroup ( "baseasfarcdono" ) ) then 
        if accountName then 
            aclGroupRemoveObject (aclGetGroup("baseasfarc"), "user."..accountName) 
            outputChatBox ("Conta '"..accountName.."' nao tem mais permicao!", playerSource) 
        else 
            outputChatBox ("Nome de conta errado", playerSource) 
            outputChatBox ("Correto: /removerplayer1 [nome]", playerSource) 
        end 
    end 
end 
addCommandHandler ("removerplayer1", delbase) 
  
  
function givebase (playerSource, commandName, accountName) 
    local accName = getAccountName ( getPlayerAccount ( playerSource ) ) 
    if isObjectInACLGroup ("user."..accName, aclGetGroup ( "baseasfarcdono" ) ) then 
        if accountName then 
            aclGroupAddObject (aclGetGroup("baseasfarc"), "user."..accountName) 
            outputChatBox ("Conta '"..accountName.."' agora tem permicao para abrir seu portao", playerSource) 
        else 
            outputChatBox ("Nome incorreto", playerSource) 
            outputChatBox ("Correto: /addplayer1 [accountName]", playerSource) 
        end 
    end 
end 
  
addCommandHandler ("addplayer1", givebase) 
  

Acl.xml

  
    <group name="baseasfarc"> 
        <object name="resource.baseasfarc"></object> 
        <object name="user.asfarc"></object> 
    </group> 
    <group name="baseasfarcdono"> 
        <object name="resource.baseasfarc"></object> 
        <object name="user.asfarc"></object> 
    </group> 
  

Link to comment

I dont see anything wrong.Try this:

Command:

  
function delbase (commandName, accountName) 
    local accName = getAccountName ( getPlayerAccount ( source ) ) 
    if isObjectInACLGroup ("user."..accName, aclGetGroup ( "baseasfarcdono" ) ) then 
        if accountName then 
            aclGroupRemoveObject (aclGetGroup("baseasfarc"), "user."..accountName) 
            outputChatBox ("Conta '"..accountName.."' nao tem mais permicao!", source) 
        else 
            outputChatBox ("Nome de conta errado", source) 
            outputChatBox ("Correto: /removerplayer1 [nome]", source) 
        end 
    end 
end 
addCommandHandler ("removerplayer1", delbase) 
  
  
function givebase (commandName, accountName) 
    local accName = getAccountName ( getPlayerAccount ( source ) ) 
    if isObjectInACLGroup ("user."..accName, aclGetGroup ( "baseasfarcdono" ) ) then 
        if accountName then 
            aclGroupAddObject (aclGetGroup("baseasfarc"), "user."..accountName) 
            outputChatBox ("Conta '"..accountName.."' agora tem permicao para abrir seu portao", source) 
        else 
            outputChatBox ("Nome incorreto", source) 
            outputChatBox ("Correto: /addplayer1 [accountName]", source) 
        end 
    end 
end 
  
addCommandHandler ("addplayer1", givebase) 
  

Acl.xml

  
    <group name="baseasfarc"> 
        <object name="resource.baseasfarc"></object> 
        <object name="user.asfarc"></object> 
    </group> 
    <group name="baseasfarcdono"> 
        <object name="resource.baseasfarc"></object> 
        <object name="user.asfarc"></object> 
    </group> 
  

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