#RooTs Posted January 9, 2016 Posted January 9, 2016 (edited) hello guys, because it is giving bad argument in "isObjectInACLGroup" already I looked at several examples in WiFi, but could not solve local acls = { "Moderator", "S-Moderadora", "SuperModerator", "Admin","Console","Sub.dono" } addEventHandler( "onResourceStart", resourceRoot, function() for _,v in pairs(getElementsByType("player")) do bindKey(v, "2", "down", toggleGodMode) end end ) addEventHandler( "onPlayerJoin", root, function() bindKey(source, "2", "down", toggleGodMode) end ) function toggleGodMode(thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) for _, k in pairs ( acls ) do if isObjectInACLGroup ("user."..accName, aclGetGroup(k)) then if getElementData(thePlayer,"invincible") then setElementData(thePlayer,"invincible",false) else setElementData(thePlayer,"invincible",true) end break end end end Edited January 9, 2016 by Guest
#RooTs Posted January 9, 2016 Author Posted January 9, 2016 isObjectInACLGroup(..) is server-sided. Yes, is server side <script src="s_godmode.lua" type="server"></script>
Revolt Posted January 9, 2016 Posted January 9, 2016 for _, k in ipairs ( acls ) do I think this should be ipairs instead of pairs.
#RooTs Posted January 9, 2016 Author Posted January 9, 2016 for _, k in ipairs ( acls ) do I think this should be ipairs instead of pairs. not, the error still continues
#RooTs Posted January 9, 2016 Author Posted January 9, 2016 I managed to find the error. thank you friend @Revolt
Bonsai Posted January 9, 2016 Posted January 9, 2016 Seems there is no such group then. Use "aclGroupList" instead of your table.
#RooTs Posted January 9, 2016 Author Posted January 9, 2016 Seems there is no such group then.Use "aclGroupList" instead of your table. that was same it. since I removed the nonexistent group Thanks
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