Hallo Leute ich brauche wiedermal eure Hilfe.
Ich habe ein Online-Admins script auf meinen Tactics server geladen.
Wenn ich /admins mache kommen die Admins die Online sind aber wenn noch ein Supermoderator/Moderator online ist tauchen die in der Liste nicht auf.
Hier das Script:
Lua
addCommandHandler("admins",function(p)
local Admins,SuperModerators,Moderator = getOnlineAdmins() -- the function will return 3 tables
if #Admins ~= 0 then -- if the admins table not empty then
outputChatBox("Online Admins",p,255,0,0,true)
for k,v in ipairs ( Admins ) do -- loop the table
outputChatBox(""..getPlayerName(v),p,255,128,0,true) -- output the player name
end
end
end )
function getOnlineAdmins()
local t1,t2,t3 = {},{},{}
for k,v in ipairs ( getElementsByType("player") ) do
local acc = getPlayerAccount(v);if not acc or isGuestAccount(acc) then return end;local accName = getAccountName(acc)
local isAdmin,isSMOD,isMod = isObjectInACLGroup("user."..accName,aclGetGroup("Admin")),isObjectInACLGroup("user."..accName,aclGetGroup("SuperModerator")),isObjectInACLGroup("user."..accName,aclGetGroup("Moderator"))
if isAdmin == true then
table.insert(t1,v)
elseif isSMOD == true then
table.insert(t2,v)
elseif isMod == true then
table.insert(t3,v)
end
return t1,t2,t3
end
end
Alles anzeigen
Wo muss ich was umschreiben damit Moderatoren und Supermoderatoren auch angezeigt werden?
Hab schon alles versucht aber nix hilft.
Mit freundlichen Grüßen,
Sneakbreaker