Jump to content

alcgroupaddobject


-misterX-

Recommended Posts

two things, one, (line 26) the console reports warning bad argument; two (line 29) error attempt to concatenate local ourGroup a boolean value

    function addACLGroupObject ( thePlayer, commandName, groupName) 
        local ourGroup = aclGetGroup ( groupName ) 
        -- if there is no previous group with this name, we need to create one 
        if ourGroup then 
        warnText("this goup already exist",thePlayer)     
         end      
            ourGroup = aclCreateGroup ( groupName ) 
         -- and finally let's add the object to it's group 
        local account = getPlayerAccount(thePlayer) 
        local accountN = getAccountName(account) 
        aclGroupAddObject ( ourGroup, 'user.'..accountN ) 
        setAccountData(account, "group", ourGroup) 
        setElementData(thePlayer, "group", ourGroup) 
        warnText( "Group created:"..ourGroup , thePlayer ) 
        -- don't forget to save the ACL after it has been modified 
        aclSave () 
         
    end 
    addCommandHandler ( "creategroup", addACLGroupObject ) 
  

Link to comment
two things, one, (line 26) the console reports warning bad argument; two (line 29) error attempt to concatenate local ourGroup a boolean value
    function addACLGroupObject ( thePlayer, commandName, groupName) 
        local ourGroup = aclGetGroup ( groupName ) 
        -- if there is no previous group with this name, we need to create one 
        if ourGroup then 
        warnText("this goup already exist",thePlayer)     
         end      
            ourGroup = aclCreateGroup ( groupName ) 
         -- and finally let's add the object to it's group 
        local account = getPlayerAccount(thePlayer) 
        local accountN = getAccountName(account) 
        aclGroupAddObject ( ourGroup, 'user.'..accountN ) 
        setAccountData(account, "group", ourGroup) 
        setElementData(thePlayer, "group", ourGroup) 
        warnText( "Group created:"..ourGroup , thePlayer ) 
        -- don't forget to save the ACL after it has been modified 
        aclSave () 
         
    end 
    addCommandHandler ( "creategroup", addACLGroupObject ) 
  

you need this for all player?

Link to comment
  
  
 function addACLGroupObject ( thePlayer, commandName, groupName) 
        local ourGroup = aclGetGroup ( groupName ) 
        -- if there is no previous group with this name, we need to create one 
        if ourGroup then 
        return warnText("this goup already exist",thePlayer)     
        end     
        ourGroup = aclCreateGroup ( groupName ) 
         -- and finally let's add the object to it's group 
        local account = getPlayerAccount(thePlayer) 
        local accountN = getAccountName(account) 
        aclGroupAddObject ( ourGroup, 'user.'..accountN ) 
        setAccountData(account, "group", ourGroup) 
        setElementData(thePlayer, "group", ourGroup) 
        warnText( "Group created:"..ourGroup , thePlayer ) 
        -- don't forget to save the ACL after it has been modified 
        aclSave () 
        
    end 
    addCommandHandler ( "creategroup", addACLGroupObject ) 
  
  

Link to comment
  
 function addACLGroupObject ( thePlayer, commandName, groupName) 
        local ourGroup = aclGetGroup ( groupName ) 
        -- if there is no previous group with this name, we need to create one 
        if ourGroup then 
            return warnText("this goup already exist",thePlayer)     
        end     
        ourGroup = aclCreateGroup ( groupName ) 
         -- and finally let's add the object to it's group 
        local account = getPlayerAccount(thePlayer) 
        local accountN = getAccountName(account) 
        aclGroupAddObject ( ourGroup, 'user.'..accountN ) 
        setAccountData(account, "group",tostring(groupName)) 
        setElementData(thePlayer, "group", tostring(groupName)) 
        warnText( "Group created:"..tostring(groupName), thePlayer ) 
        -- don't forget to save the ACL after it has been modified 
        aclSave () 
    end 
    addCommandHandler ( "creategroup", addACLGroupObject ) 
  
  

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