Jump to content

[AJUDA] Somente uma ACL pode utilizar o comando


Recommended Posts

Posted

Oi, estou a bastante tempo tentando solucionar um problema em um script e não estou conseguindo. O script é de contagem regressiva, e eu estou tentando por para que somente "X" acl possa utilizar o comando, que até então, o script está permitindo que todos utilizem.

 

este é o script virgem, sem as minhas modificações falhas;

 

countdRunning = false
function conteoTick (thePlayer)
    se restante == 0 then
        killTimer (conteoTimer)
        playSoundFrontEnd (root, 45)
        outputChatBox ("VAI VAI VAI!", root, 0,188,0)
        countdRunning = false
    else
        playSoundFrontEnd (root, 44)
        local factorGreen = 255 / (countdStart-1)
        local resultadoGreen = factorGreen * restante-factorGreen
        local factorSpaces = 12 / (countdStart-1)
        local resultSpaces = math.floor (factorSpaces * restante-factorSpaces)
        local permanentStr = ""
        para i = 0, resultSpaces do
            restanteStr = restanteStr .. ""
        end
        restanteStr = restanteStr .. restante
        outputChatBox (restanteStr, root, 255, resultadoGreen, 0) 
        restante = restante - 1
    end
end
addCommandHandler ("contar", função (thePlayer, cmd, startArg)
--addCommandHandler ("countd", função (thePlayer , cmd, startArg)
--addCommandHandler ("contagem regressiva", função (thePlayer, cmd, startArg)
--addCommandHandler ("conteo", função (thePlayer, cmd, startArg)
    se countdRunning then
        outputChatBox ("Já existe uma contagem regressiva atual" , thePlayer)
        return
    else
        if startArg and tonumber (startArg) then
            countdStart = tonumber (startArg)
        else
            countdStart = 3
        end
        if countdStart ~ = 3 and countdStart ~ = 4 then
            outputChatBox ("Disponível apenas: 3 e 4", thePlayer, 255,0,0)
            return
        end
        restante = countdStart
        outputChatBox (getPlayerName (thePlayer) .. "# FF8C00começouçou uma contagem regressiva ", root,
        255.255.255 , true) conteoTick (thePlayer)
        conteoTimer = setTimer (conteoTick, 1000,0, thePlayer)
        countdRunning = true
    end
end)
 

  • Other Languages Moderators
Posted

Olá.

Utilize o botão <> do fórum para postar scripts. Não cole direto no texto.

OfSmewi.png

Posted (edited)

pronto esse é o code dele com os <>

 

Spoiler

countdRunning = false
function conteoTick (thePlayer)
    se restante == 0 then
        killTimer (conteoTimer)
        playSoundFrontEnd (root, 45)
        outputChatBox ("VAI VAI VAI!", root, 0,188,0)
        countdRunning = false
    else
        playSoundFrontEnd (root, 44)
        local factorGreen = 255 / (countdStart-1)
        local resultadoGreen = factorGreen * restante-factorGreen
        local factorSpaces = 12 / (countdStart-1)
        local resultSpaces = math.floor (factorSpaces * restante-factorSpaces)
        local permanentStr = ""
        para i = 0, resultSpaces do
            restanteStr = restanteStr .. ""
        end
        restanteStr = restanteStr .. restante
        outputChatBox (restanteStr, root, 255, resultadoGreen, 0) 
        restante = restante - 1
    end
end
addCommandHandler ("contar", função (thePlayer, cmd, startArg)
--addCommandHandler ("countd", função (thePlayer , cmd, startArg)
--addCommandHandler ("contagem regressiva", função (thePlayer, cmd, startArg)
--addCommandHandler ("conteo", função (thePlayer, cmd, startArg)
    se countdRunning then
        outputChatBox ("Já existe uma contagem regressiva atual" , thePlayer)
        return
    else
        if startArg and tonumber (startArg) then
            countdStart = tonumber (startArg)
        else
            countdStart = 3
        end
        if countdStart ~ = 3 and countdStart ~ = 4 then
            outputChatBox ("Disponível apenas: 3 e 4", thePlayer, 255,0,0)
            return
        end
        restante = countdStart
        outputChatBox (getPlayerName (thePlayer) .. "# FF8C00começouçou uma contagem regressiva ", root,
        255.255.255 , true) conteoTick (thePlayer)
        conteoTimer = setTimer (conteoTick, 1000,0, thePlayer)
        countdRunning = true
    end
end)

 

 

Edited by #RooTs
edit
Posted
20 hours ago, M4DD NØG said:

Com isso você consegue fazer, isObjectInACLGroup

if isObjectInACLGroup("user." ..getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then

 

Se ele usar desta forma vai dar erro.

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