Помогите со скриптом пожалуйста, этот скрипт показывает онлайн админов, но он показывает вот так:
Online admins list: Admins: name, name, name SuperModerators: name, name Moderators: name, name, name
А как сделать что бы он показывал вот так?
Online admins list:
Admins: name, name, name
SuperModerators: name, name,name
Moderators: name, name
local admins = ""
function processAdminList()
players = getElementsByType ( "player" )
admins = ""
for k,v in ipairs(players) do
local accountname = ""
if (isGuestAccount(getPlayerAccount(v)) == false) then
accountname = getAccountName (getPlayerAccount(v))
if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then
if (admins == "") then
admins = "Admins: "..getPlayerName(v)
else
admins = admins .. ", a: " .. getPlayerName(v)
end
end
if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "SuperModerator" ) ) then
if (admins == "") then
admins = "SuperModerators: "..getPlayerName(v)
else
admins = admins .. ", b: " .. getPlayerName(v)
end
end
if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Moderator" ) ) then
if (admins == "") then
admins = "Moderators: "..getPlayerName(v)
else
admins = admins .. ", c: " .. getPlayerName(v)
end
end
end
end
end
addEventHandler( "onPlayerLogin", getRootElement(), processAdminList ) addEventHandler( "onPlayerLogout", getRootElement(), processAdminList ) addEventHandler( "onPlayerQuit", getRootElement(), processAdminList )
function setAdminList(Player,command)
if admins ~= "" then
outputChatBox("Online Admins: "..admins , Player, 255 , 255, 0)
else
outputChatBox("No admins online." , Player, 255 , 255, 0)
end
end
addCommandHandler("admins", setAdminList)
function tAdmins(message,messageType)
if message == "!admins" or message == "!Admins" or message =="!onlineadmins" then
local playeraccount = getPlayerAccount(source)
if admins ~= "" then
outputChatBox("Online Admins: "..admins , getRootElement(), 255 , 255, 0)
else
outputChatBox("No admins online." , getRootElement(), 255 , 255, 0)
end
end
end
addEventHandler("onPlayerChat",getRootElement(),tAdmins)