Jump to content

Command dont work :/


Sasu

Recommended Posts

Posted
--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?

State: Inactive

Posted

Why do you say that? the loop will check if you're on one of these groups.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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 
) 

To Visit Us

Press Here: mtasa://5.9.206.180:22002

b648040241b8f01.png

0d0a7bb38ca13e5.png

Posted
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 
) 

State: Inactive

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...