function onKill(cid, target)
if isPlayer(cid) and isPlayer(target) then
local skill = getPlayerSkillLevel(cid, SKILL_FIST)
local tries = 1
while (skill == getPlayerSkillLevel(cid, SKILL_FIST)) do
doPlayerAddSkillTry(cid, SKILL_FIST, tries)
end
end
return true
end
function onPrepareDeath(cid, deathList)
if isPlayer(cid) then
local skill = getPlayerSkillLevel(cid, SKILL_CLUB)
local tries = 1
while (skill == getPlayerSkillLevel(cid, SKILL_CLUB)) do
doPlayerAddSkillTry(cid, SKILL_CLUB, tries)
end
end
return true
end
Assim fica funcional, você só precisa por algum script pra não perder skills quando o player morrer.






info
Grupo: Visconde
Registrado: 21/12/06
Posts: 355
Reputação: +118
Gênero: Masculino
Queria um script, que ao matar 1 player, o player que matou ganha +1 skill de first...
E
queria outro script que ao morrer, voce ganha +1 skill de club...
peguei uma funcao, adicionei lib
function doPlayerSetSkill(cid, skill, amount) local pid = getPlayerGUID(cid) doRemoveCreature(cid,true) db.executeQuery("UPDATE `player_skills` SET `value` = ".. amount .." WHERE `player_id` = ".. pid .. " and `skillid` = ".. skill ..";") return TRUE end function doPlayerSetMagic(cid, amount) local pid = getPlayerGUID(cid) doRemoveCreature(cid,true) db.executeQuery("UPDATE `players` SET `maglevel` = " .. amount .. " WHERE `id` = "..pid) return TRUE ende usei este script,
PROBLEMAS:
* o char nao morre... ele fica sem a barra de life e mana e nao morre!
* o player que mata, nao ganha o skill de fist..
Como arrumo isso para nao dar bugs, se alguem tiver outra solução, poste aqui por favor!