Fácil caro amigo, da pra fazer isso em TalkActions..
Vá na pasta de seu OTSERV e crie um arquivo chamado onlinelist.lua e cole isso dentro do arquivo:
function onSay(cid, words, param)
local onlineList = getPlayersOnlineList()
local str = ""
for i, uid in ipairs(onlineList) do
if(i == 1) then
str = "Players Online: " .. getPlayerName(uid)
else
str = str .. ", " .. getPlayerName(uid)
end
end
str = str .. ".\nTotal: " .. #onlineList .. " players."
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, words)
return FALSE
end
Agora vá em TalkActions.xml e coloque isso
<talkaction words="!online" script="onlinelist.lua" />
Simples !!!
Tibia World RPG OldSchool Developer!
