quando vc coloca no ot !online mosta
19:29 1 player(s) online:19:29 [GOD] Kaylos [100000].
como faço apenas para mostrar a quantidade de player, sem mostrar o nick e level, apenas assim
19:29 100 player(s) online
.
quando vc coloca no ot !online mosta
19:29 1 player(s) online:19:29 [GOD] Kaylos [100000].
como faço apenas para mostrar a quantidade de player, sem mostrar o nick e level, apenas assim
19:29 100 player(s) online
.
Estou com a mesma Dúvida.
Tomara que algum scripter venah aqui pra ajudar.
Depois de 2 anos voltei ao Xtibia. Conta nova, mundo Novo!
Gostou de mim? Te Ajudei? Faz um +REP.
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
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
Em qual dos arquivos modifico para este para o !Online funcionar com esta adptação?
Lalala~
Quer ajuda para criar seu Tópico perfeitamente? PM
Em talkaction/script/online.lua
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
Obrigado; Vou testar isso em meu servidor assim que conseguir ligar ele novamente *-*
Lalala~
Quer ajuda para criar seu Tópico perfeitamente? PM
"O fracasso é a oportunidade de se começar de novo inteligentemente"