Ir para conteúdo

Featured Replies

Postado

Parabéns!!

Muito obrigado, a Storage estava 1020.

Coloquei 500 e funcionou 100%.

Agora pra ficar legal... Falta um Rank reset, e !online mostrando reset!

Agradeço! Ficou TOP!

  • Respostas 46
  • Visualizações 4.7k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Consegui testar agora. player.cpp, troque sua função getDescription por essa:

  • Fir3element
    Fir3element

    function onSay(cid, words, param)     local player = Player(cid)     local hasAccess = player:getGroup():getAccess()     local players = Game.getPlayers()     local playerCount = Game.getPlayerCount()

Postado

online.lua (tfs 1.1)

function onSay(player, words, param)
    local function getPlayerResets()
        local resets = player:getStorageValue(500)
        return resets < 0 and 0 or resets
    end

    local hasAccess = player:getGroup():getAccess()
    local players = Game.getPlayers()
    local playerCount = Game.getPlayerCount()

    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, playerCount .. " players online.")

    local i = 0
    local msg = ""
    for k, tmpPlayer in ipairs(players) do
        if hasAccess or not tmpPlayer:isInGhostMode() then
            if i > 0 then
                msg = msg .. ", "
            end
            msg = msg .. tmpPlayer:getName() .. " (" .. tmpPlayer:getLevel() .. ") [Resets: " .. getPlayerResets() .. "]"
            i = i + 1
        end

        if i == 10 then
            if k == playerCount then
                msg = msg .. "."
            else
                msg = msg .. ","
            end
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, msg)
            msg = ""
            i = 0
        end
    end

    if i > 0 then
        msg = msg .. "."
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, msg)
    end
    return false
end
 
Postado

Erro :

Lua Script Error: [TalkAction Interface]
data/talkactions/Script/Online:onsay
data/talkactions/script/online:7: attempt to index local 'player' <a number valuve>
stack traceback:
    [C]: in function '__index'
    data/talkactions/script/online:7: in function <data/talkactions/script/online.lua>
  

Postado

function onSay(cid, words, param)
    local player = Player(cid)
    local function getPlayerResets()
        local resets = player:getStorageValue(500)
        return resets < 0 and 0 or resets
    end

    local hasAccess = player:getGroup():getAccess()
    local players = Game.getPlayers()
    local playerCount = Game.getPlayerCount()

    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, playerCount .. " players online.")

    local i = 0
    local msg = ""
    for k, tmpPlayer in ipairs(players) do
        if hasAccess or not tmpPlayer:isInGhostMode() then
            if i > 0 then
                msg = msg .. ", "
            end
            msg = msg .. tmpPlayer:getName() .. " (" .. tmpPlayer:getLevel() .. ") [Resets: " .. getPlayerResets() .. "]"
            i = i + 1
        end

        if i == 10 then
            if k == playerCount then
                msg = msg .. "."
            else
                msg = msg .. ","
            end
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, msg)
            msg = ""
            i = 0
        end
    end

    if i > 0 then
        msg = msg .. "."
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, msg)
    end
    return false
end
 
Postado

Mostra mais da apenas um problema :

 

!online do Player Killer :

18:29 2 players online.
18:29 Killer (208) [Resets: 2], {ADM} Master Viciado (8) [Resets: 2].

 

!online do {ADM} :

18:29 2 players online.
18:29 Killer (208) [Resets: 20], {ADM} Master Viciado (8) [Resets: 20].

 

EDIT* Killer tem 2 resets, {ADM} tem 20**

Editado por Marjer (veja o histórico de edições)

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo