Jump to content

Imprimir players off de um ACL


Recommended Posts

  • Other Languages Moderators

É impossível obter jogadores que não estão online. Mas vc pode obter todos os logins registrados em tal ACL Group.

addCommandHandler ("listgroup", function (thePlayer, cmd, aclGroup) -- Teste usando /listgroup Admin
    if (aclGroup) then
        if (not aclGetGroup(aclGroup)) then
            return outputChatBox ("ACL Group '"..aclGroup.."' não existe.", thePlayer, 255, 0, 0)
        end
        local table = aclGroupListObjects (aclGetGroup(aclGroup))
        outputChatBox ("Logins registrados na ACL Group "..aclGroup..":", thePlayer)
        for _,name in pairs(table) do
            local objType = gettok (name, 1, string.byte('.')) -- objType recebe tudo que estiver antes do ponto.
            if (objType == "user") then -- Se o que estiver antes do ponto for "user", então:
                local login = gettok (name, 2, string.byte('.')) -- login recebe tudo que estiver depois do ponto.
                outputChatBox (login, thePlayer)
            end
        end
    else
        outputChatBox ("Erro de sintaxe. Use /listgroup <ACLGroup>", thePlayer, 255, 0, 0)
    end
end)

 

  • Like 1
  • Thanks 1
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...