marty000123 Posted November 12, 2016 Share Posted November 12, 2016 When I check the console or /debugscript 3, everytime someone says something in the chat I get this: [2016-11-12 15:39:13] WARNING: admintag\server.lua:98: Bad argument @ 'isObjectInACLGroup' [Expected acl-group at argument 2, got boolean] Does anyone have an idea what to do? Thanx. Link to comment
LoPollo Posted November 12, 2016 Share Posted November 12, 2016 (edited) The problem is (as you may think) that whatever is in the second argument of the function isObjectInACLGroup at line 98 of the resource admintag, file server.lua, is returning (probably) false. Can you give us the code of that file (server.lua)? At least the portion around that line including also the functions there called. This way we can see where the cause of the error "start", and how to fix/handle it. Also, by reading the wiki, i can assume that at the second argument there's a call to the function aclGetGroup, which Returns false/nil if it [the acl group] did not exist or [the function itslef] failed for some reason. Edited November 12, 2016 by LoPollo Link to comment
marty000123 Posted November 13, 2016 Author Share Posted November 13, 2016 for _,v in ipairs(settings['adminTag']['ACL']) do if isObjectInACLGroup('user.' .. account, aclGetGroup(v[1])) and check == 0 and not spam[serial] then local message = v[2] .. RGBToHex(r, g, b) .. name .. ":#FFFFFF " .. text If you need more lines please let me know. Link to comment
LoPollo Posted November 13, 2016 Share Posted November 13, 2016 (edited) The string in v[1] (where v is every value of settings['adminTag']['ACL'] ) is not a valid ACL group (and therefore the aclGetGroup returns false). You could try adding an outputChatBox (or equivalent) to see what v[1] contain: for _,v in ipairs(settings['adminTag']['ACL']) do outputChatBox(v[1]) if isObjectInACLGroup('user.' .. account, aclGetGroup(v[1])) and check == 0 and not spam[serial] then local message = v[2] .. RGBToHex(r, g, b) .. name .. ":#FFFFFF " .. text Is the outputted value supposed to be an acl group? And is it a string in first place? Edited November 13, 2016 by LoPollo Link to comment
Gravestone Posted November 13, 2016 Share Posted November 13, 2016 1 hour ago, marty000123 said: for _,v in ipairs(settings['adminTag']['ACL']) do if isObjectInACLGroup('user.' .. account, aclGetGroup(v[1])) and check == 0 and not spam[serial] then local message = v[2] .. RGBToHex(r, g, b) .. name .. ":#FFFFFF " .. text If you need more lines please let me know. Post the full function Link to comment
LoPollo Posted November 13, 2016 Share Posted November 13, 2016 (edited) @Gravestone i'm more interested about the content of settings['adminTag']['ACL'] It should be a table containing tables starting with the string of the acl group: if this is defined somewhere, it would be helpful seeing it. Otherwise are required all the functions that access this variable, with all the functions that calls these function, and all these functions that call these... basically all the script Edited November 13, 2016 by LoPollo 1 Link to comment
marty000123 Posted November 13, 2016 Author Share Posted November 13, 2016 (edited) http://pastebin.com/EmKaK0h5 I didn't make the script myself but made some edits. Might have :Oed something up, but I can't figure out what's wrong. Edited November 13, 2016 by marty000123 Link to comment
LoPollo Posted November 13, 2016 Share Posted November 13, 2016 (edited) settings['adminTag']['ACL'] is a table of tables starting with the string of an acl group these are the groups defined in the script { 'serverowner', '#FFFF00Server Owner ' }, { 'HQStaff', '#FFFF00HQ STAFF ' }, { 'Administrator', '#FFFF00Administrator ' }, { 'SeniorMod', '#FFFF00Senior Mod ' }, { 'Modgroup', '#FFFF00Moderator ' }, { 'Probationary', '#FFFF00Probationary ' }, { 'Scripter', '#FFFF00Scripter ' }, { 'Mapper', '#FFFF00Mapper ' }, { 'Premium', '#FF0000[Premium] '}, { 'VIP', '#9900FF[VIP] '}, { 'dp', '#00FFFFVeteran '}, { 'Everyone', ' ' } They are supposed to be valid: so the only reason for aclGetGroup to return false is that, even if the "syntax" is valid, the group does not exists. By default MTA has these groups: (source) Everyone Moderator SuperModerator Admin Console RPC so when the script tries to find the group that are not specified in the acl.xml file the aclGetGroup returns false and the problem starts. So if until now i did not forgot anything and didn't make any error, there are these solutions: Add a check to the script: if the group does not exists then for sure there are no players in it Edit the part of the script where the groups are defined (the part i posted above) Edit the acl (when server is off) adding these groups A mix of these is also possible. Notes: with the first solution players in groups that are not defined within the script will cause problems, so i recommend the second solution Edited November 13, 2016 by LoPollo 1 Link to comment
marty000123 Posted November 13, 2016 Author Share Posted November 13, 2016 I still don't have a clue about what to do because the script works, I added those groups to the ACL, and it's giving a Warning as output, not an ERROR. So everything should be fine but still it gives the warning everytime someone says something. I really suck at scripting so I'm probably missing something obvious. Link to comment
LoPollo Posted November 13, 2016 Share Posted November 13, 2016 (edited) I can't see why it gives you the warning if you edited the acl and then all the groups are found is the warning the same? WARNING: admintag\server.lua:98: Bad argument @ 'isObjectInACLGroup' [Expected acl-group at argument 2, got boolean] I still suggest to add the default groups to the script to prevent a player in these groups (defined in the acl but not in the script) gets not properly handled Edited November 13, 2016 by LoPollo Link to comment
marty000123 Posted November 13, 2016 Author Share Posted November 13, 2016 After looking in the script again, I found that I forgot to place one group in the ACL. I now fixed it by removing that 1 group from the script. Thanks for the help 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