Postado Junho 22, 2013 11 anos Estou com esse script que mostra quantos kills e deaths o player tem , mais ele não está funcionando e nem da erro no distro , qual será o problema? <?xml version="1.0" encoding="UTF-8"?> <mod name="KDR SYSTEM" version="1.0" author="Narko" contact="[email protected]" 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>
Postado Junho 22, 2013 11 anos Acho q esta faltando coisa ai amigo, procure o tópico de onde o tirou e reveja se esta td certo
Postado Junho 22, 2013 11 anos Estou com esse script que mostra quantos kills e deaths o player tem , mais ele não está funcionando e nem da erro no distro , qual será o problema? Se ele não funciona e não da erro no distro então você não instalo ele, me conte como você instalou o script Editado Junho 22, 2013 11 anos por KekezitoLHP (veja o histórico de edições)
Postado Junho 22, 2013 11 anos Autor Se ele não funciona e não da erro no distro então você não instalo ele, me conte como você instalou o script No topico original so tem isso o Mod e pronto :/ Acho q esta faltando coisa ai amigo, procure o tópico de onde o tirou e reveja se esta td certo Eu vou na pasta mods faço um arquivo xml colo o script dentro dele ligo o serv e pronto mais ele não funfa , tem um serv mexicano que tem um igual a ele , queria muito ele :/
Postado Junho 23, 2013 11 anos <?xml version="1.0" encoding="UTF-8"?> <mod name="KDR SYSTEM" version="1.0" author="Narko" contact="[email protected]" 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> e na database ALTER TABLE `players` ADD `frags` INT( 11 ) NOT NULL DEFAULT '0'; ALTER TABLE `players` ADD `deaths` INT( 11 ) NOT NULL DEFAULT '0'; ver agora com esse Editado Junho 23, 2013 11 anos por KekezitoLHP (veja o histórico de edições)
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.