local table = {
[SKULL_WHITE] = 'White Skull',
[SKULL_RED] = 'Red Skull',
[SKULL_BLACK] = 'Black Skull'
}
function onSay(cid, words, param, channel)
local strings, i, position, added = {''}, 1, 1, false
for _, pid in ipairs(getPlayersOnline()) do
if(added) then
if(i > (position * 7)) then
strings[position] = strings[position] .. ','
position = position + 1
strings[position] = ''
else
strings[position] = i == 1 and '' or strings[position] .. ', '
end
end
added = false
if getCreatureSkullType(pid) > 2 then
strings[position] = strings[position] .. getCreatureName(pid) .. ' [' .. table[getCreatureSkullType(pid)] .. ']'
i = i + 1
added = true
end
end
if i == 1 then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'No skulled players online.')
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (i - 1) .. ' skulled player' .. (i > 1 and 's' or '') .. ' online:')
for i, str in ipairs(strings) do
if(str:sub(str:len()) ~= ',') then
str = str .. '.'
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str)
end
return true
end