local showLevels = 1
local maxPlayers = 0
local showAccess = {
[0] = "yes", --Players
[1] = "no", --GMs
[2] = "no", --God
}
function onSay(cid, words, param)
players = getOnlinePlayers()
count = 0
numPlayers = 0
text = ""
for i = 1,#players do
p = getPlayerByName(players[i])
for j = 1, #showAccess do
access = j - 1
if getPlayerAccess(p) == access then
if showAccess[access] == "yes" then
count = count + 1
numPlayers = numPlayers + 1
if count == maxPlayers then
count = 0
text = text .. ", " .. players[i]
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, text)
elseif count == 1 then
text = players[i]
else
text = text .. ", " .. players[i]
end
if showLevels == 1 then
text = text .. "["..getPlayerLevel(p).."]"
end
end
end
end
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, text .."\n")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, numPlayers.." player(s) online.")
end