DE
talkaction

[ Talkaction ]!online Mostrando Level E Reset

Por DevilMoon, 12 de jun. de 2010 em Actions e Talkactions

tibia
script
otserv
24
7.6k
30 de setembro de 2011 às 11:03

legal o script. Mas acho que é uma invasão de privacidade.

11 meses depois...
pachtP
19 de agosto de 2012 às 13:39

ae adorei o script mais queria saber como faço pra so aparecer o nome do player que esta online e o level dele ^^

 

rolleyes.gif

SubwatS
19 de agosto de 2012 às 21:33

cara seu script está errado, ele vai mostrar de todo mundo que tiver online o mesmo reset por que está em cid em vez de pid ali.

 

 

certo seria assim.

local config = {
showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand'))
}

function getResets(pid)
resets = getPlayerStorageValue(pid,2310)
if resets < 0 then
resets = 0
end
return resets
end

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) .. " [resets ".. getResets(pid) .."]"
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

zani123Z
21 de agosto de 2012 às 14:27

Seria viavelmente possível uma talkactions mostrar level, resets e ainda cada vocação de um character?

VodkartV
21 de agosto de 2012 às 15:19

Seria viavelmente possível uma talkactions mostrar level, resets e ainda cada vocação de um character?

 

sem dúvida que sim

SubwatS
21 de agosto de 2012 às 15:39

da pra fazer mostrar level,resets,vocation, e até mesmo quantos dias de premium tem ali u.u

1 ano depois...
kaizy536K
08 de janeiro de 2014 às 23:11

o meu sistema de reset nao é por storage, como faço pra apareçer o reset no online? a funçao que pega o reset é

getPlayerReset(cid)
KilluaK
09 de janeiro de 2014 às 14:13

 

o meu sistema de reset nao é por storage, como faço pra apareçer o reset no online? a funçao que pega o reset é

getPlayerReset(cid)

 

Assim:

 


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) .. " [resets ".. getPlayerResets(pid) .."]"
            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

 

 

kaizy536K
09 de janeiro de 2014 às 16:36

vlw mano, vo testar mais tarde :)


eu tive que adicionar a funçao pra reconhecer kkk, mais fora isso funcionou de boa, vlw :)