function getOnlineAdmins()
local t = {}
for k,v in ipairs ( getElementsByType("player") ) do
while true do
local acc = getPlayerAccount(v)
if not acc or isGuestAccount(acc) then break end
local accName = getAccountName(acc)
local isAdmin = isObjectInACLGroup("user."..accName,aclGetGroup("Admin"))
if isAdmin == true then
table.insert(t,v)
end
break
end
end
return t
end
function getOnlineAdmins()
local t = {}
for k,v in ipairs ( getElementsByType("player") ) do
while true do
local acc = getPlayerAccount(v)
if not acc or isGuestAccount(acc) then break end
local accName = getAccountName(acc)
local isAdmin = isObjectInACLGroup("user."..accName,aclGetGroup("Admin"))
if isAdmin == true then
table.insert(t,v)
end
break
end
end
return t
end
function getOnlineModerator()
local t = {}
for k,v in ipairs ( getElementsByType("player") ) do
while true do
local acc = getPlayerAccount(v)
if not acc or isGuestAccount(acc) then break end
local accName = getAccountName(acc)
local isModerator = isObjectInACLGroup("user."..accName,aclGetGroup("Moderator"))
if isModerator == true then
table.insert(t,v)
end
break
end
end
return t
end
[ Dodano: 2013-07-22, 14:54 ]
Jak do tego kodu doda?, ?e jak kto? np. jest w grupie ACL. w "admins" to zeby kolo jego nicku widnia? napis " - Zarzad" ?
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("Administracja Online:",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
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach