abu5lf Posted March 15, 2012 Share Posted March 15, 2012 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
myonlake Posted March 15, 2012 Share Posted March 15, 2012 (edited) 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 March 15, 2012 by Guest Link to comment
abu5lf Posted March 15, 2012 Author Share Posted March 15, 2012 He repeated my name twice * Admins: CX.83, | CX.83,* SuperModerator: Link to comment
myonlake Posted March 15, 2012 Share Posted March 15, 2012 Copy the script again, let me know. Link to comment
Castillo Posted March 15, 2012 Share Posted March 15, 2012 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
myonlake Posted March 15, 2012 Share Posted March 15, 2012 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. Link to comment
Castillo Posted March 15, 2012 Share Posted March 15, 2012 I never said it was, but two options are better than one, right? I know that Kenix make's it look like a competition, but I don't. Link to comment
mjau Posted March 15, 2012 Share Posted March 15, 2012 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now