Estou com a mesma Dúvida.
Tomara que algum scripter venah aqui pra ajudar.
info
Group: Campones
Joined: 11/05/08
Posts: 21
Reputation: +3
Tibia Character: Admin Necrox

Estou com a mesma Dúvida.
Tomara que algum scripter venah aqui pra ajudar.
info
Group: Barão
Joined: 05/08/10
Posts: 218
Reputation: +86
Gender: Masculino

Veja se e isso que vc quer.
local config = {
showGamemasters = getBooleanFromString(getConfigInfo('displayGamemastersWithOnlineCommand'))
}
function onSay(cid, words, param)
local players = getPlayersOnline()
local strings = {}
local i = 1
local position = 1
for _, pid in ipairs(players) do
if(i > (position * 7)) then
strings[position] = strings[position] .. ","
position = position + 1
else
strings[position] = i == 1 and "" or strings[position] .. ", "
end
if((config.showGamemasters == TRUE or getPlayerCustomFlagValue(cid, PlayerCustomFlag_GamemasterPrivileges) == TRUE or getPlayerCustomFlagValue(pid, PlayerCustomFlag_GamemasterPrivileges) ~= TRUE) and (isPlayerGhost(pid) ~= TRUE or getPlayerAccess(cid) > getPlayerAccess(pid))) then
strings[position] = strings[position] ..''
i = i + 1
end
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (i - 1) .. " player(s) 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
Edited Outubro 1 by mulizeu
info
Group: Barão
Joined: 17/12/07
Posts: 217
Reputation: +45

isso mesmo, mas dei uma adaptação nele, pois o que vc postou mostra 2 linhas.
ta ai pra quem quizer usar
local config = {
showGamemasters = getBooleanFromString(getConfigInfo('displayGamemastersWithOnlineCommand'))
}
function onSay(cid, words, param)
local players = getPlayersOnline()
local strings = {}
local i = 1
local position = 1
for _, pid in ipairs(players) do
if(i > (position * 7)) then
strings[position] = strings[position] .. ","
position = position + 1
else
strings[position] = i == 1 and "" or strings[position] .. ""
end
if((config.showGamemasters == TRUE or getPlayerCustomFlagValue(cid, PlayerCustomFlag_GamemasterPrivileges) == TRUE or getPlayerCustomFlagValue(pid, PlayerCustomFlag_GamemasterPrivileges) ~= TRUE) and (isPlayerGhost(pid) ~= TRUE or getPlayerAccess(cid) > getPlayerAccess(pid))) then
strings[position] = strings[position] ..''
i = i + 1
end
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (i - 1) .. " player(s) online no Moekanos Baiak 3.0")
for i, str in ipairs(strings) do
if(str:sub(str:len()) ~= "") then
end
end
return TRUE
end
info
Group: Campones
Joined: 18/10/08
Posts: 39
Reputation: +1
Tibia Character: [GOD] YaK

Em qual dos arquivos modifico para este para o !Online funcionar com esta adptação?
info
Group: Artesão
Joined: 12/08/11
Posts: 110
Reputation: +39

Em talkaction/script/online.lua
info
Group: Campones
Joined: 29/08/11
Posts: 18
Reputation: +16
Tibia Character: Invencible Invisible

eu peguei o meu !online que mostra os players e os levels e fiz uma alteração, ve esse funciona
local config = {
showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand'))
}
function onSay(cid, words, param, channel)
local players = getPlayersOnline()
local strings = {""}
local i, position = 1, 1
local added = FALSE
for _, pid in ipairs(players) 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
if((config.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]
i = i + 1
added = TRUE
else
added = FALSE
end
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (i - 1) .. " player(s) 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
aqui eu testei e funcionou, testado no The forgotten server 0.4_svn
Edited Outubro 12 by TheFog
info
Group: Campones
Joined: 18/10/08
Posts: 39
Reputation: +1
Tibia Character: [GOD] YaK

Obrigado; Vou testar isso em meu servidor assim que conseguir ligar ele novamente *-*
info
Group: Herói
Joined: 28/11/10
Posts: 3.4k
Reputation: +585
Gender: Masculino

info
Group: Barão
Joined: 17/12/07
Posts: 217
Reputation: +45
quando vc coloca no ot !online mosta
como faço apenas para mostrar a quantidade de player, sem mostrar o nick e level, apenas assim
.