muito bom para servers de war, obrigado por postar bons conteudos ao Xtibia!
- Fórum
- OTServ
- Recursos
- Scripting
- Mods, funções e outros
- Kill E Death Ratio
4
1.9k
3 semanas depois...
info
Grupo: Herói
Registrado: 23/12/08
Posts: 2.4k
Reputação: +359
Gênero: Masculino
Char no Tibia: Gordo Warlike

27 de março de 2012 às 01:34
1 ano depois...
22 de junho de 2013 às 01:08
não pego aqui e não deu erro no distro.
1 mês depois...





info
Grupo: Infante
Registrado: 27/07/09
Posts: 1.5k
Reputação: +405
Char no Tibia: Gean Riot
MODS:
<?xml version="1.0" encoding="UTF-8"?> <mod name="KDR SYSTEM" version="1.0" author="Narko" contact="crmb92@hotmail.com" enabled="yes"> <event type="kill" name="killpoint" event="script"><![CDATA[ function onKill(cid, target, damage, flags) if isPlayer(target) == true then db.query("UPDATE `players` SET `frags` = `frags` + 1 WHERE id = " .. getPlayerGUID(cid) .. ";") doCreatureSay(cid, '+1 Frag Point!', TALKTYPE_ORANGE_1) end return true end ]]></event> <event type="preparedeath" name="deathpoint" event="script"><![CDATA[ function onPrepareDeath(cid, deathList, lastHitKiller, mostDamageKiller) if isPlayer(cid) == true then db.query("UPDATE `players` SET `deaths` = `deaths` + 1 WHERE id = " .. getPlayerGUID(cid) .. ";") doCreatureSay(cid, '+1 Death Point!', TALKTYPE_ORANGE_1) end return true end ]]></event> <event type="look" name="KdrLook" event="script"><![CDATA[ function onLook(cid, thing, position, lookDistance) function getKillsPlayer(cid) local Info = db.getResult("SELECT `frags` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. " LIMIT 1") local frags= Info:getDataInt("frags") return frags end function getDeathsPlayer(cid) local Info = db.getResult("SELECT `deaths` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. " LIMIT 1") local deaths= Info:getDataInt("deaths") return deaths end if isPlayer(thing.uid) then local kdr = getKillsPlayer(thing.uid)/getDeathsPlayer(thing.uid) doPlayerSetSpecialDescription(thing.uid, (getPlayerSex(thing.uid) == 0 and "\nShe" or "\nHe") .. " has Killed: ["..getKillsPlayer(thing.uid).."] Players."..(getPlayerSex(thing.uid) == 0 and "\nShe" or "\nHe") .. " has Died: ["..getDeathsPlayer(thing.uid).."] Times.\nThe Kdr(Kill Death Ratio) is: ["..kdr.."].") end if(thing.uid == cid) then local kdr = getKillsPlayer(thing.uid)/getDeathsPlayer(thing.uid) doPlayerSetSpecialDescription(thing.uid, "\nYou have Killed: ["..getKillsPlayer(thing.uid).."] Players.\nYou have Died: ["..getDeathsPlayer(thing.uid).."] Times.\nYou Kdr(Kill Death Ratio) is: ["..kdr.."].") end return true end ]]></event> <event type="login" name="KdrLook" event="buffer"><![CDATA[ registerCreatureEvent(cid, "KdrLook") registerCreatureEvent(cid, "killpoint") registerCreatureEvent(cid, "deathpoint") _result = true ]]></event> </mod>Dando Look No player vai mostrar quantas Vezes você morreu,quantas vezes matou alguém,e o percentual de death/kill.
Créditos:
Narko