..:D&G:.. Posted October 19, 2014 Posted October 19, 2014 Hey guys, I keep getting an error, from the isObjectInACLGroup and I don't know why.. The error is: Expected acl-group at argument 2, got boolean Function: function getGroups( player ) local g = { } if p[ player ] then for key, value in ipairs( groups ) do if isObjectInACLGroup( "user." .. p[ player ].username, aclGetGroup( value.aclGroup ) ) then table.insert( g, value ) end end table.sort( g, function( a, b ) return a.priority > b.priority end ) end return g end Now, I can't really understand these errors, they don't make sense to me (but they will once..), so if anyone knows why I keep getting the error, please let me know MTA:Rust Pre-Alpha Build v.0.3: https://forum.mtasa.com/viewtopic.php?f=114&t=97848 2Pac: ''Only God can judge me!''
Anubhav Posted October 19, 2014 Posted October 19, 2014 Show the table groups. See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
..:D&G:.. Posted October 19, 2014 Author Posted October 19, 2014 Sure, here you go: local groups = { { groupName = "MTA Trial Moderators", groupID = false, aclGroup = "Trial", displayName = "Trial", nametagColor = { 255, 255, 191 }, priority = 3 }, { groupName = "MTA Moderators", groupID = false, aclGroup = "Moderator", displayName = "Moderator", nametagColor = { 255, 255, 127 }, priority = 5 }, { groupName = "MTA Administrators", groupID = false, aclGroup = "Admin", displayName = "Administrator", nametagColor = { 255, 255, 0 }, priority = 10, defaultForFirstUser = true }, { groupName = "Developers", groupID = false, aclGroup = "Developer", displayName = "Developer", nametagColor = { 127, 255, 127 }, priority = 20, defaultForFirstUser = true }, } MTA:Rust Pre-Alpha Build v.0.3: https://forum.mtasa.com/viewtopic.php?f=114&t=97848 2Pac: ''Only God can judge me!''
Anubhav Posted October 19, 2014 Posted October 19, 2014 function getGroups( player ) local g = { } if p[ player ] then for key, value in ipairs( groups ) do if isObjectInACLGroup( "user." .. p[ player ].username, aclGetGroup( value[key].aclGroup ) ) then table.insert( g, value ) end end table.sort( g, function( a, b ) return a.priority > b.priority end ) end return g end See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
..:D&G:.. Posted October 19, 2014 Author Posted October 19, 2014 Can you tell me what was wrong and how you fixed it please? MTA:Rust Pre-Alpha Build v.0.3: https://forum.mtasa.com/viewtopic.php?f=114&t=97848 2Pac: ''Only God can judge me!''
Anubhav Posted October 19, 2014 Posted October 19, 2014 [quote name=..&G:..]Can you tell me what was wrong and how you fixed it please? You looped through a table which had tables inside it and no tag like aclGroup="hi'. So what I did is, when you looped i just added [key]! So it detects the table and get the aclGroup tag value from it. See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
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