Ir para conteúdo
  • Cadastre-se

(Resolvido)[BUG] Frag Look- Kills And Dead


Ir para solução Resolvido por lucaspds,

Posts Recomendados

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)
Link para o post
Compartilhar em outros sites
Link para o post
Compartilhar em outros sites
  • 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/ <<<<

Link para o post
Compartilhar em outros sites
  • 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

×   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.


  • Conteúdo Similar

    • Por lucasromero
      Gostaria que me explicassem como funciona essas 3 funções:

      getDirectionTo(pos1, pos2)
      getPlayerLookPos(cid)
      getPosByDir(fromPosition, direction, size)

      Não precisa explicar todas, se explicar pelo menos uma eu agradeço.
       
    • Por Darkagron
      boa, eu to tentando arruma em um ot novos pokes ou items com (tm's) ja sei como mais mim problema e com o look do os pokes/items e com o corpse pq em o client nao ta mostrando, alguem mim fala com eu posso resolve isso?

      Obs: eu uso object builder par arruma os items

      ou pode mim falar um melhor editor?

      pq o numero do itemid nao e o mesmo .dat/.spr com do object buiilder ?? :/
       
      O xml do poke
      <?xml version="1.0" encoding="UTF-8"?> <monster name="Gliscor" nameDescription="a gliscor" race="flying" experience="0" speed="185" manacost="0"> <health now="40" max="40"/> <look type="1447" head="65" body="80" legs="95" feet="113" corpse="12063"/> <targetchange interval="10000" chance="0"/> Alguem pode mim ajuda o q nao to fazendo bem?





       
    • Por Henrique Rezende
      Olá! Estou fazendo um OT, e encontrei alguns problemas sem resposta. Pelo menos não vi nenhum tópico relacionado, então resolvi perguntar.
       
      Um dos problemas é no Dead Human. No pvp, quando um player mata o outro, ele simplesmente desaparece, e não cai o Dead Human. Ou seja, se dropar algum loot dele eu não vou saber.
      Como não encontrei ajuda, tentei trocar a distro e o problema persistiu. Uso um TSF 0.4 , OTserv 8.60. Espero que alguém possa me ajudar!!
       
       
    • Por Slim Shady
      Bug Resolvido... podem fechar o topíco, obrigado.
    • Por principe sharingan
      Para fazer isso é facil é so vc abrir a pasta do seu server ir em data/creaturescripts/scripts e abra o arquivo Login e deve ter uma tag tipo essa:
       
      doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 100)
       
      *Quantidade de experiencia que o player pode perder. Se você por 0, quando o player morrer não irá perder nada !
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo