-misterX- Posted January 14, 2013 Share Posted January 14, 2013 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
MR.S3D Posted January 14, 2013 Share Posted January 14, 2013 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
AhmadQTR Posted January 14, 2013 Share Posted January 14, 2013 local ourGroup = aclGetGroup ( groupName ) At ( groupname ) type your group name in ACL. Link to comment
MR.S3D Posted January 14, 2013 Share Posted January 14, 2013 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
-misterX- Posted January 14, 2013 Author Share Posted January 14, 2013 yes i need it for all players and still reports the same error, cant concatenate Link to comment
MR.S3D Posted January 14, 2013 Share Posted January 14, 2013 yes i need it for all playersand still reports the same error, cant concatenate write command with player name or account? Link to comment
-misterX- Posted January 14, 2013 Author Share Posted January 14, 2013 what you mean? the command create an acl group whit the name specified, then it add the account name as object Link to comment
csiguusz Posted January 14, 2013 Share Posted January 14, 2013 ourGroup is not a string, it's an ACL group, so can't concatenate it. -- use this warnText( "Group created:"..groupName , thePlayer ) -- or this: warnText( "Group created:"..aclGroupGetName(ourGroup) , thePlayer ) Link to comment
MR.S3D Posted January 14, 2013 Share Posted January 14, 2013 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now