Mr.Loki Posted August 26, 2015 Share Posted August 26, 2015 when i change the resource settings in the admin panel and i add multiple ACL groups to get('cinemaCommand') it does not work but if I change the setting to only have 1 ACL group it works. addEventHandler('onPlayerCommand',root, function(comm) if comm == get('cinemaCommand') then acls = get('cinemaACLAccess') gnames = split(acls, ',') for i, group in ipairs(gnames)do if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup(group)) then triggerClientEvent('openViewer',source) else triggerClientEvent('stvi',source,"You do not have access to this command.") end end end end ) Link to comment
KariiiM Posted August 26, 2015 Share Posted August 26, 2015 (edited) Try this addEventHandler('onPlayerCommand',root, function(comm) if comm == get('cinemaCommand') then local acls = get('cinemaACLAccess') local gnames = split(acls, ';') for i, group in ipairs(gnames)do if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup(group)) then triggerClientEvent('openViewer',source) else triggerClientEvent('stvi',source,"You do not have access to this command.") end end end end) Edited August 26, 2015 by Guest Link to comment
Mr.Loki Posted August 26, 2015 Author Share Posted August 26, 2015 wow the script just randomly started to working... just wtf.... first i tried your code and it worked then i tried the original code and it also worked If im not wrong, you can't send a full message like outputChatBox message inside the trigger functions triggerClientEvent('stvi',source,"You do not have access to this command.") yep you can lol works like normal outputChatbox now my problem is since im using for to loop through my function it has to run through all the groups so even tho im in admin and im not in moderator, the window would show and i'd get the access denied text how can i cancel it? 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