Jump to content

onLine Admins


abu5lf

Recommended Posts

admins = "" 
SuperModerator = "" 
  
  
  
function processAdminList() 
   players = getElementsByType ( "player" ) 
   admins = "" 
   SuperModerator = "" 
   for k,v in ipairs">ipairs(players) do 
      local accountname = "" 
      if (isGuestAccount(getPlayerAccount(v)) == false) then 
         accountname = getAccountName (getPlayerAccount(v)) 
                if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then 
                  
                if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "SuperModerator" ) )  
                 then 
            if (admins == "") then 
               admins = getPlayerName(v,o) 
               admins = admins .. " | " .. getPlayerName(v,o) 
             elseif (SuperModerator == "")  
            then   SuperModerator = getPlayerName(v,i)  
               SuperModerator = SuperModerator .. " | " .. getPlayerName(v,i) 
end 
            end 
         end 
       
  
   outputChatBox( "* Admins  :  #307D7E".. tostring">tostring( admins ), getRootElement(), 255, 255, 0 ,true) 
     outputChatBox( "* SuperModerator  :    #307D7E".. tostring">tostring( SuperModerator ), getRootElement(), 255, 255, 0 ,true) 
  
end 
end 
end 

Do not show me the right way

Link to comment

Try this.

I had to remove the lua-tags since they're bugged.

local admins = "" 
local SuperModerator = "" 
  
function processAdminList() 
    players = getElementsByType("player") 
    for k,v in ipairs(players) do 
        local accountname = "" 
        if not isGuestAccount(getPlayerAccount(v)) then 
            local accountname = getAccountName(getPlayerAccount(v)) 
            if isObjectInACLGroup("user." .. accountname, aclGetGroup("Admin")) then 
                if admins == "" then 
                    admins = admins .. " | " .. getPlayerName(v) 
                end 
            end 
             
            if isObjectInACLGroup("user." .. accountname, aclGetGroup("SuperModerator")) then 
                if SuperModerator == "" then 
                    SuperModerator = SuperModerator .. " | " .. getPlayerName(v) 
                end 
            end 
        end 
    end 
    outputChatBox("* Admins: #307D7E" .. tostring(admins), root, 255, 255, 0, true) 
    outputChatBox("* SuperModerator: #307D7E" .. tostring(SuperModerator), root, 255, 255, 0, true) 
end 

Edited by Guest
Link to comment
local admins = {} 
local superModerators = {} 
  
function processAdminList() 
    admins = {} 
    superModerators = {} 
    for index, player in ipairs">ipairs( getElementsByType ( "player" ) ) do 
        if not isGuestAccount ( getPlayerAccount ( player ) ) then 
            local accountName = getAccountName ( getPlayerAccount ( player ) ) 
            if isObjectInACLGroup ("user.".. accountName, aclGetGroup ( "Admin" ) ) then 
                table.insert( admins, getPlayerName ( player ) ) 
            elseif isObjectInACLGroup ("user.".. accountName, aclGetGroup ( "SuperModerator" ) ) then 
                table.insert( superModerators, getPlayerName ( player ) ) 
            end 
        end 
    end 
    outputChatBox("* Admins: #307D7E".. table.concat ( admins, "," ), root, 255, 255, 0, true) 
    outputChatBox("* SuperModerator: #307D7E" .. table.concat ( superModerators, "," ), root, 255, 255, 0, true) 
end 

Link to comment
Solidsnake, I know you like to help, but I am preferring to let the first answerer solve the situation - this is not a competition, even though you and Kenix make it look like one.

if you got a version of the code wich is bettter(shorter faster etc) then its no rule saying your not allowed to post it

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