Ir para conteúdo

Featured Replies

Postado

OLA GALERA DO TK.

Encontrei aqui no forum um script muito interessante que gostaria de colocar no meu ot, porém, está bugado, está mostrando corretamente ao dar look as kills e as deaths, porém, quando alguem mata sobe tanto o numero de kills como de death... 

 56d717303d1b2_killsedeaths.png.6e5f48c1a.

Se o player "Safadao", matar outra pessoa, mesmo sem ele morrer ficam correspondentemente (Frags: 6 - Deaths: 12)

 

Gostaria de saber se alguém aqui consegui concertar, caso não consigam se conseguem remover do look as Deaths, pois só os frags funcionando normalmente já seria otimo, aguardo respostas e desde já, obrigado.

 

As instruções no post original eram V

 

Vá em creaturescripts/creaturescripts.xml : e adicione essa linha:

 

Spoiler

 

<event type="look" name="showKD" event="script" value="KillsandDeath.lua"/>

 

Após isso, crie um arquivo chamado KillsandDeath.lua e adiciona isso

Spoiler


function getDeaths(cid)
   local query, d = db.getResult("SELECT `player_id` FROM `player_killers` WHERE `player_id` = " ..getPlayerGUID(cid)), 0
   if (query:getID() ~= -1) then
      repeat
         d = d+1
      until not query:next()
      query:free()
   end
   return d  
end

function getPlayerFrags(cid)
    local time = os.time()
    local times = {today = (time - 86400), week = (time - (7 * 86400))}
    local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")
    if(result:getID() ~= -1) then
        repeat
            local content = {date = result:getDataInt("date")}
            if(content.date > times.today) then
                table.insert(contents.day, content)
            elseif(content.date > times.week) then
                table.insert(contents.week, content)
            else
                table.insert(contents.month, content)
            end
        until not result:next()
        result:free()
    end
 
    local size = {
        day = table.maxn(contents.day),
        week = table.maxn(contents.week),
        month = table.maxn(contents.month)
    }
    return size.day + size.week + size.month
end

function onLook(cid, thing, position, lookDistance)
   if isPlayer(thing.uid) and thing.uid ~= cid then
      return doPlayerSetSpecialDescription(thing.uid, '\n'.. '[Frags: ' .. getPlayerFrags(thing.uid) .. ' - Deaths: ' .. getDeaths(thing.uid) .. ']')
   elseif thing.uid == cid then     
      local string = 'You see yourself.'
      if getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION) then
         string = string..' You are '.. getPlayerGroupName(cid) ..'.'
      elseif getPlayerVocation(cid) ~= 0 then
         string = string..' You are '.. getPlayerVocationName(cid) ..'.'
      else
         string = string..' You have no vocation.'
      end
               

      if getPlayerGuildId(cid) > 0 then
         string = string..' You are ' .. (getPlayerGuildRank(cid) == '' and 'a member' or getPlayerGuildRank(cid)) ..' of the '.. getPlayerGuildName(cid)
         string = getPlayerGuildNick(cid) ~= '' and string..' ('.. getPlayerGuildNick(cid) ..').' or string..'.'
      end
      
      string = string..'\n'.. '[Frags: ' .. getPlayerFrags(cid) .. ' - Deaths: ' .. getDeaths(cid) .. ']'

      if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS) then
         string = string..'\nHealth: ['.. getCreatureHealth(cid) ..' / '.. getCreatureMaxHealth(cid) ..'], Mana: ['.. getCreatureMana(cid) ..' / '.. getCreatureMaxMana(cid) ..'].'
         string = string..'\nIP: '.. doConvertIntegerToIp(getPlayerIp(cid)) ..'.'
      end

      if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION) then
         string = string..'\nPosition: [X:'.. position.x..'] [Y:'.. position.y..'] [Z:'.. position.z..'].'
      end
      return false, doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string)  
   end
   return 1
end

 

Depois vá em login.lua e adicione isso :

Spoiler

registerCreatureEvent(cid, "showKD")

 

 

Creditos do script : http://www.tibiaking.com/forum/topic/38343-frag-look-kills-and-dead-premium/

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

Resolvido por lucaspds

Ir para solução
Postado
  • Autor
  • Solução
32 minutos atrás, ciroc disse:

Muito obrigado por tentar ajudar, mas vasculhando pelo forum, encontrei outro script q funcionou corretamente, vou deixar aqui como resposta o Script q funcionou pra mim para ajudar os proximos membros


>>> http://www.tibiaking.com/forum/topic/57782-mostrar-a-quantidade-que-morreu-e-que-matou-ao-dar-look-no-player/ <<<<

  • 2 years later...

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