Jump to content

Command dont work :/


Sasu

Recommended Posts

--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 :S . Can you say me why?

Link to comment
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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...