Ir para conteúdo
  • Cadastre-se

(Resolvido)[PEDIDO] Editar meu !online


Ir para solução Resolvido por zipter98,

Posts Recomendados

Com o GOD e meu kina online fica

13:24 2 players online:
13:24 Elite Maikon [72], Suport Maikon [30].
13:24 Vocations: Elite Knight [1], Druid [1].

Queria remover essa linha
13:24 Elite Maikon [72], Suport Maikon [30].

Pra ficar assim
13:24 2 players online:
13:24 Vocations: Elite Knight [1], Druid [1].


E queria configurar pra aparecer o dobro de player sempre
Tipo:
Se eu tive-se logado no Elite Maikon e no Suport Maikon
em vez de ser
13:24 2 players online:
13:24 Vocations: Elite Knight [1], Druid [1].

Ser
13:24 4 players online:
13:24 Vocations: Elite Knight [2], Druid [2].

Pra dar impressão de OT mais cheio

 

 

Meu !online

local config = {
    showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand')),
    showLevel = "yes",
    showVocations = "yes"
}

config.showLevel, config.showVocations = getBooleanFromString(config.showLevel), getBooleanFromString(config.showVocations)
function onSay(cid, words, param, channel)
    local strings, i, position, added, vocations, vocStr = {""}, 1, 1, false, {}, ""
    for _, pid in ipairs(getPlayersOnline()) 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(vocations[getPlayerVocation(pid)] ~= nil) then
            vocations[getPlayerVocation(pid)] = vocations[getPlayerVocation(pid)] + 1
        else
            vocations[getPlayerVocation(pid)] = 1
        end

        added = false
        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) .. ""..(config.showLevel and " [" .. getPlayerLevel(pid) .. "]" or "")..""
            i = i + 1
            added = true
        end
    end

    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (i - 1) .. " player" .. (i > 1 and "s" or "") .. " 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
    if(config.showVocations) then
        for vocId, quant in pairs(vocations) do
            vocStr = vocStr .. ""..getVocationInfo(vocId).name.." ["..quant.."], "
        end
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Vocations: "..vocStr:gsub(", $", "."))
    end
    return true
end
Link para o post
Compartilhar em outros sites
  • Solução
local config = {
    showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand')),
    showLevel = "yes",
    showVocations = "yes"
}

config.showLevel, config.showVocations = getBooleanFromString(config.showLevel), getBooleanFromString(config.showVocations)
function onSay(cid, words, param, channel)
    local i, position, vocations, vocStr = 0, 1, {}, ""
    for _, pid in ipairs(getPlayersOnline()) do
        i = i + 1
        if(vocations[getPlayerVocation(pid)] ~= nil) then
            vocations[getPlayerVocation(pid)] = vocations[getPlayerVocation(pid)] + 1
        else
            vocations[getPlayerVocation(pid)] = 1
        end
    end

    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (i * 2) .. " player" .. ((i * 2) and "s" or "") .. " online:")
    if(config.showVocations) then
        for vocId, quant in pairs(vocations) do
            vocStr = vocStr .. ""..getVocationInfo(vocId).name.." ["..(quant * 2).."], "
        end
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Vocations: "..vocStr:gsub(", $", "."))
    end
    return true
end
Editado por zipter98 (veja o histórico de edições)

não respondo pms solicitando suporte em programação/scripting

Link para o post
Compartilhar em outros sites

Ah, já vi o erro: esqueci de colocar uma vírgula na linha 9. Código corrigido, agora vai funcionar.

PS: Bugs como este, geralmente, são informados no console. Você não deve ter reparado.

não respondo pms solicitando suporte em programação/scripting

Link para o post
Compartilhar em outros sites

Ah, já vi o erro: esqueci de colocar uma vírgula na linha 9. Código corrigido, agora vai funcionar.

PS: Bugs como este, geralmente, são informados no console. Você não deve ter reparado.

 

Vlw funcionou, te dei 3 reps ai

Link para o post
Compartilhar em outros sites
  • 1 month later...

Consegui

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

Ajudei? da um Rep+, não custa nada. ;D:P

 

Servidor de PokeTibia ja online.

Pagina: https://www.facebook.com/PokemonxStore?ref=bookmarks

Grupo: https://www.facebook.com/groups/257989224406246/

Site: http://pokexstore.wix.com/pokexstore

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo