function onSay(cid, words, param, channel)
local showGamemasters,on,count = false,getPlayersOnline(),0
for _, cid in pairs(on) do
if getPlayerAccess(cid) < 3 then
count = count + 1
end
end
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,(showGamemasters == true and #on or count).." player(s) online.")
end
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

info
Grupo: Marquês
Registrado: 06/11/11
Posts: 1.1k
Reputação: +109
Char no Tibia: Stroked

Na pasta talkactions do seu ot, crie um arquivo lua chamado online, e coloque isso dentro:
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] .. getCreatureName(pid) .. " [" .. getPlayerLevel(pid) .. "]"
i = i + 1
added = TRUE
else
added = FALSE
end
end
doPlayerSendTextMessage(cid,22, (i - 1) .. " jogador(s) online no servidor!")
for i, str in ipairs(strings) do
if(str:sub(str:len()) ~= ",") then
str = str .. "."
end
end
return TRUE
end
a tag que vai no xml é essa:
<talkaction words="!online" event="script" value="online.lua"/>
Caso eu tenha ajudado, +REP
)
Editado Setembro 8 por GuizitoG
GuizitoG o seu script n funcionou ![]()
Vodkart eu keria que tb aparecece na tela do jogador em verde a msm coisa que aparece no default
info
Grupo: Marquês
Registrado: 06/11/11
Posts: 1.1k
Reputação: +109
Char no Tibia: Stroked

LooL, como assim n funfou?? oq eu fiz apareçe em granco na tela do jogador... normalmente. Aki funciona perfeitamente
Eu presiso pra um server 8.4 , e aki o seu não funcionou :S
info
Grupo: Marquês
Registrado: 06/11/11
Posts: 1.1k
Reputação: +109
Char no Tibia: Stroked

da algum erro no distro e talz??
[08/09/2012 16:53:58] Lua Script Error: [TalkAction Interface]
[08/09/2012 16:53:58] data/talkactions/scripts/online.lua:onSay
[08/09/2012 16:53:58] data/talkactions/scripts/online.lua:19: attempt to call global 'getPlayerGhostAccess' (a nil value)
[08/09/2012 16:53:58] stack traceback:
[08/09/2012 16:53:58] data/talkactions/scripts/online.lua:19: in function <data/talkactions/scripts/online.lua:4>
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

function onSay(cid, words, param, channel)
local showGamemasters,on,count = false,getPlayersOnline(),0
for _, cid in pairs(on) do
if getPlayerAccess(cid) < 3 then
count = count + 1
end
end
return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,(showGamemasters == true and #on or count).." player(s) online.")
end
info
Grupo: Conde
Registrado: 03/01/12
Posts: 884
Reputação: +233
Char no Tibia: Segredo

GuizitoG o seu script n funcionou
Vodkart eu keria que tb aparecece na tela do jogador em verde a msm coisa que aparece no default
function onSay(cid, words, param, channel) local showGamemasters,on,count = false,getPlayersOnline(),0 for _, cid in pairs(on) do if getPlayerAccess(cid) < 3 then count = count + 1 end end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,(showGamemasters == true and #on or count).." player(s) online.") return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,(showGamemasters == true and #on or count).." player(s) online.") end
Dúvida Sanada
edit
Vodkart ta on
nem mostra aqui em baixo kkk
Editado Setembro 8 por notle2012
Vlw Vodkart o seu funcionou perfeitamente REP+





info
Grupo: Campones
Registrado: 31/08/12
Posts: 27
Reputação: 0
presiso de um comando que somente monstre o numero de players online no !online sem aparecer os nomes deles
Quem me ajudar Dou REP+