Sasu Posted July 2, 2013 Share Posted July 2, 2013 --Server local adminACL = { "Admin", "SuperModerator", "Moderator", "Console" } addCommandHandler("update", function(source) local playerAcc = getPlayerAccount(source) local accName = getAccountName(playerAcc) for _, objects in ipairs(adminACL) do if isObjectInACLGroup ("user."..accName, aclGetGroup ( objects ) ) then triggerClientEvent(source, "onAdminCommandUpdate", source) end end end ) --Client addEvent("onAdminCommandUpdate", true) addEventHandler("onAdminCommandUpdate", root, function() guiSetVisible(updatePanel, true) showCursor(true) end ) I don't know why this scripts works in my local server and when I upload to another server dont work . Can you say me why? Link to comment
iMr.3a[Z]eF Posted July 2, 2013 Share Posted July 2, 2013 YOU'LL HAVE TO BE IN ALL GROUPS Link to comment
Castillo Posted July 2, 2013 Share Posted July 2, 2013 Why do you say that? the loop will check if you're on one of these groups. Link to comment
iMr.3a[Z]eF Posted July 2, 2013 Share Posted July 2, 2013 Why do you say that? the loop will check if you're on one of these groups. this will works as far as i know -- server local adminACL = {} adminACL[1] = { "Admin" } adminACL[2] = { "SuperModerator" } adminACL[3] = { "Moderator" } adminACL[4] = { "Console" } addCommandHandler("update", function(source) local playerAcc = getPlayerAccount(source) local accName = getAccountName(playerAcc) for _, objects in ipairs(adminACL) do if isObjectInACLGroup ("user."..accName, aclGetGroup ( adminACL[1] ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( adminACL[2] ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( adminACL[3] ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( adminACL[4] ) ) then triggerClientEvent(source, "onAdminCommandUpdate", source) end end end ) --Client addEvent("onAdminCommandUpdate", true) addEventHandler("onAdminCommandUpdate", root, function() guiSetVisible(updatePanel, true) showCursor(true) end ) Link to comment
Sasu Posted July 2, 2013 Author Share Posted July 2, 2013 Why do you say that? the loop will check if you're on one of these groups. this will works as far as i know -- server local adminACL = {} adminACL[1] = { "Admin" } adminACL[2] = { "SuperModerator" } adminACL[3] = { "Moderator" } adminACL[4] = { "Console" } addCommandHandler("update", function(source) local playerAcc = getPlayerAccount(source) local accName = getAccountName(playerAcc) for _, objects in ipairs(adminACL) do if isObjectInACLGroup ("user."..accName, aclGetGroup ( adminACL[1] ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( adminACL[2] ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( adminACL[3] ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( adminACL[4] ) ) then triggerClientEvent(source, "onAdminCommandUpdate", source) end end end ) --Client addEvent("onAdminCommandUpdate", true) addEventHandler("onAdminCommandUpdate", root, function() guiSetVisible(updatePanel, true) showCursor(true) end ) So I dont need the table -.- . Anyway I have just resolved. --Server local adminACL = { "Admin", "SuperModerator", "Moderator", "Console" } addEvent("updateOn", true) addEventHandler("updateOn", root, function() local playerAcc = getPlayerAccount(source) local accName = getAccountName(playerAcc) for _, objects in ipairs(adminACL) do if isObjectInACLGroup ("user."..accName, aclGetGroup ( objects ) ) then triggerClientEvent(source, "onAdminCommandUpdate", source) end end end ) --Client addEvent("onAdminCommandUpdate", true) addEventHandler("onAdminCommandUpdate", root, function() guiSetVisible(updatePanel, true) showCursor(true) end ) addCommandHandler("update", function() triggerServerEvent("updateOn", localPlayer) end ) 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