Estou com a mesma Dúvida.
Tomara que algum scripter venah aqui pra ajudar.
info
Grupo: Campones
Registrado: 11/05/08
Posts: 21
Reputação: +3
Char no Tibia: Admin Necrox

Estou com a mesma Dúvida.
Tomara que algum scripter venah aqui pra ajudar.
info
Grupo: Barão
Registrado: 05/08/10
Posts: 218
Reputação: +86
Gênero: 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
Editado Outubro 1 por mulizeu
info
Grupo: Barão
Registrado: 17/12/07
Posts: 217
Reputação: +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
Grupo: Campones
Registrado: 18/10/08
Posts: 39
Reputação: +1
Char no Tibia: [GOD] YaK

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

Em talkaction/script/online.lua
info
Grupo: Campones
Registrado: 29/08/11
Posts: 18
Reputação: +16
Char no Tibia: 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
Editado Outubro 12 por TheFog
info
Grupo: Campones
Registrado: 18/10/08
Posts: 39
Reputação: +1
Char no Tibia: [GOD] YaK

Obrigado; Vou testar isso em meu servidor assim que conseguir ligar ele novamente *-*
info
Grupo: Herói
Registrado: 28/11/10
Posts: 3.4k
Reputação: +585
Gênero: Masculino

info
Grupo: Barão
Registrado: 17/12/07
Posts: 217
Reputação: +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
.