hello again
I got a !online command to show how many players are online
it look like that:
-------------
is any easy way to "show more" - i mean players names?
like after type !online
it will show
01:43 1 players online: Player Name
or
01:43 3 players online: Player Name1, Player Name2, Player Name3
?
I got a !online command to show how many players are online
it look like that:
Lua:
function onSay(cid, words, param, channel)
if(not checkExhausted(cid, 666, 10)) then
return false
end
local strings, i, position, added, showGamemasters = {""}, 1, 1, false, getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand'))
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((showGamemasters or getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES) or not getPlayerCustomFlagValue(pid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) and (not isPlayerGhost(pid) or getPlayerGhostAccess(cid) >= getPlayerGhostAccess(pid))) then
strings[position] = strings[position] .. getCreatureName(pid) .. " [" .. getPlayerLevel(pid) .. "]"
i = i + 1
added = true
end
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (i - 1) .. " player" .. (i > 1 and "s" or "") .. " online:")
for i, str in ipairs(strings) do
if(str:sub(str:len()) ~= ",") then
str = str .. "."
end
end
return true
end
-------------
is any easy way to "show more" - i mean players names?
like after type !online
it will show
01:43 1 players online: Player Name
or
01:43 3 players online: Player Name1, Player Name2, Player Name3
?