Ir para conteúdo
  • 0

[Talkactions] Sistema Online Diferente


AdilsonHacker

Pergunta

Eai Galera suave ? bom vim aqui pedir a ajuda de vocês .. preciso de um script !online diferente que ele funcione normalmente só que no final apareça tipo isso .

 

EXEMPLO / IMAGEM :MrQC0M.png

 

Desde já , agradeço !

Link para o comentário
Compartilhar em outros sites

11 respostass a esta questão

Posts Recomendados

  • 0

Substitua a talkaction online.lua por essa:

 

local config = {
    showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand'))
}
 
function onSay(cid, words, param, channel)
    local players = getPlayersOnline()
    local strings = {""}
    local vocationCount = {
        [1] = 0,
        [2] = 0,
        [3] = 0,
        [4] = 0,
    }
    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
        local voc = getPlayerVocation(pid)
        if voc > 4 then voc = voc-4 end
        vocationCount[voc] = vocationCount[voc] + 1
        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, MESSAGE_STATUS_CONSOLE_BLUE, (i - 1) .. " jogadores online:")
    for i, str in ipairs(strings) do
        if(str:sub(str:len()) ~= ",") then
            str = str .. "."
        end
        str = str .. " \n"..vocationCount[1].." sorcerers, "..vocationCount[2].." druids, "..vocationCount[3].." paladins, "..vocationCount[4].." knights jogando agora."
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str)
    end
 
    return true
end
 
Link para o comentário
Compartilhar em outros sites

  • 0

Mano primeiramente obrigado por responder meu post, mais deu um erro não funcionou não tipo meu ot tem 6 vocações , sorcerer , druid, knight , paladin , miner , elf tem como vc add ae ?


Alguém ?
Link para o comentário
Compartilhar em outros sites

  • 0

 

local config = {
    showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand'))
}
 
function onSay(cid, words, param, channel)
    local players = getPlayersOnline()
    local strings = {""}
    local vocationCount = {
        [1] = 0,
        [2] = 0,
        [3] = 0,
        [4] = 0,
        [5] = 0,
        [6] = 0,
    }
    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
        local voc = getPlayerVocation(pid)
        if voc > 6 then voc = voc-6 end
        vocationCount[voc] = vocationCount[voc] + 1
        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, MESSAGE_STATUS_CONSOLE_BLUE, (i - 1) .. " jogadores online:")
    for i, str in ipairs(strings) do
        if(str:sub(str:len()) ~= ",") then
            str = str .. "."
        end
        str = str .. " \n"..vocationCount[1].." sorcerers, "..vocationCount[2].." druids, "..vocationCount[3].." paladins, "..vocationCount[4].." knights, "..vocationCount[5].." miner, "..vocationCount[6].." elf jogando agora."
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str)
    end
 
    return true
end
Editado por Shoguns
Link para o comentário
Compartilhar em outros sites

  • 0

Deu o mesmo erro cara :/ , não funfa de jeito nenhum !

 

Esse script aki funfa é quase igual acho que vc pode dar uma editadinha!

 

 

local config = {
        showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand'))
}
 
function onSay(cid, words, param, channel)
        local players = getPlayersOnline()
        local strings = {""}
local sorc,druid,paladin,knight,rook = 0,0,0,0,0
 
        local i, position = 1, 1
        local added = false
        for _, pid in ipairs(players) do
        -- Implementacion por Xafterin.
                if isSorcerer(pid) then
                        sorc = sorc + 1
                elseif isDruid(pid) then
                        druid = druid + 1
                elseif isPaladin(pid) then
                        paladin = paladin + 1
                elseif isKnight(pid) then
                        knight = knight + 1
        end
        ---
                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, MESSAGE_STATUS_CONSOLE_BLUE, (i - 1) .. " player(s) online on OT Server:")
        for i, str in ipairs(strings) do
                if(str:sub(str:len()) ~= ",") then
                        str = str .. ". ".. sorc .." sorcerers, ".. druid .." druids, ".. paladin .." paladins, ".. knight .." knights and ".. rook .." rookies."
                end
 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str)
        end
 
        return true
end
Editado por AdilsonTsunami
Link para o comentário
Compartilhar em outros sites

  • 0

 

local config = {
        showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand'))
}
 
function onSay(cid, words, param, channel)
        local players = getPlayersOnline()
        local strings = {""}
local sorc,druid,paladin,knight,miner,elf = 0,0,0,0,0,0
 
        local i, position = 1, 1
        local added = false
        for _, pid in ipairs(players) do
        -- Implementacion por Xafterin.
                if isSorcerer(pid) then
                        sorc = sorc + 1
                elseif isDruid(pid) then
                        druid = druid + 1
                elseif isPaladin(pid) then
                        paladin = paladin + 1
                elseif isKnight(pid) then
                        knight = knight + 1
        end
        ---
                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, MESSAGE_STATUS_CONSOLE_BLUE, (i - 1) .. " player(s) online on OT Server:")
        for i, str in ipairs(strings) do
                if(str:sub(str:len()) ~= ",") then
                        str = str .. ". ".. sorc .." sorcerers, ".. druid .." druids, ".. paladin .." paladins, ".. knight .." knights ".. miner .." miners and ".. elf .." elfs."
                end
 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str)
        end
 
        return true
end
Link para o comentário
Compartilhar em outros sites

  • 0

Pegou mano. Reputado Por Ajudar mais tem um defeito... o script só ta lendo knight , sorcs ,druid,paladin .. miner e elf ele não ta lento nao . quando logo um elf diz que nao tem nenhum!

 

Acho que você esqueceu de editar essa parte :

 

        local i, position = 1, 1
        local added = false
        for _, pid in ipairs(players) do
        -- Implementacion por Xafterin.
                if isSorcerer(pid) then
                        sorc = sorc + 1
                elseif isDruid(pid) then
                        druid = druid + 1
                elseif isPaladin(pid) then
                        paladin = paladin + 1
                elseif isKnight(pid) then
                        knight = knight + 1
Editado por AdilsonTsunami
Link para o comentário
Compartilhar em outros sites

  • 0

Leia meus comentários no código


local config = {
        showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand'))
}
 
function onSay(cid, words, param, channel)
        local players = getPlayersOnline()
        local strings = {""}
local sorc,druid,paladin,knight,miner,elf = 0,0,0,0,0,0
 
        local i, position = 1, 1
        local added = false
        for _, pid in ipairs(players) do
        -- Implementacion por Xafterin.
                if isSorcerer(pid) then
                        sorc = sorc + 1
                elseif isDruid(pid) then
                        druid = druid + 1
                elseif isPaladin(pid) then
                        paladin = paladin + 1
                elseif isKnight(pid) then
                        knight = knight + 1
                        elseif isInArray({5, 5}, getPlayerVocation(pid)) then -- Coloque o id da voc miner, id da voc promote miner
                        miner = miner + 1
                        elseif isInArray({6, 6}, getPlayerVocation(pid)) then -- Coloque o id da voc elf, id da voc promote elf
                        elf = elf + 1
        end
        ---
                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, MESSAGE_STATUS_CONSOLE_BLUE, (i - 1) .. " player(s) online on OT Server:")
        for i, str in ipairs(strings) do
                if(str:sub(str:len()) ~= ",") then
                        str = str .. ". ".. sorc .." sorcerers, ".. druid .." druids, ".. paladin .." paladins, ".. knight .." knights ".. miner .." miners and ".. elf .." elfs."
                end
 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str)
        end
 
        return true
end
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...