Postado Dezembro 30, 2014 10 anos Nos dois scripts? Te ajudei?? REP + e ficamos quites... http://www.tibiaking.com/forum/uploads/emoticons/default_happyy.png' alt=';D'> Atenciosamente, Daniel. Abraços! Meus tutoriais: Programação: Resolvendo QUALQUER erro na data base. Scripts (system's, creaturescripts, mod's, NPC's, etc): (Sistema) GOD Ambient Light Full. Adicionando novas mounts ao servidor [NPC] Papai Noel que dá presente todo ano. Web-site: Resolvendo problema de caracteres especiais em PHP Formatando textos em PHP! Mudando a cor, tamanho, fonte, etc. Criando e configurando tabelas para paginas PHP
Postado Dezembro 30, 2014 10 anos Autor Correto,os fica do mesmo modo Projeto/Serviços que desenvolvi durante esse Tempo. [SERVIDOR] - NTO By Madara Rinnegan - Criado em 2014
Postado Dezembro 30, 2014 10 anos Putz... Burrei, acabei de reler o 2° script e vi que eu declarei a table errada, uma table inexistente. local stor = {} function onDeath(cid, corpse, deathList, lastHitKiller, mostDamageKiller) if isPlayer(cid) == TRUE then if (getPlayerSlotItem(cid, 2).itemid == 2173) then doCreatureSetDropLoot(cid, false) doPlayerSetLossSkill(cid, false) doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 10) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA) if #stor < 30 then table.insert(stor, (#stor + 1)) else for k in pairs(stor) do stor[k] = nil end end end end return TRUE end Tenta agora. Editado Dezembro 30, 2014 10 anos por danihcv (veja o histórico de edições) Te ajudei?? REP + e ficamos quites... http://www.tibiaking.com/forum/uploads/emoticons/default_happyy.png' alt=';D'> Atenciosamente, Daniel. Abraços! Meus tutoriais: Programação: Resolvendo QUALQUER erro na data base. Scripts (system's, creaturescripts, mod's, NPC's, etc): (Sistema) GOD Ambient Light Full. Adicionando novas mounts ao servidor [NPC] Papai Noel que dá presente todo ano. Web-site: Resolvendo problema de caracteres especiais em PHP Formatando textos em PHP! Mudando a cor, tamanho, fonte, etc. Criando e configurando tabelas para paginas PHP
Postado Dezembro 30, 2014 10 anos Faz um bom tempo que não scripteio, mas pelo que entendi da sua descrição, isso talvez baste. E eu não sei como esse AoL funciona (não jogo Tibia). Na verdade, só li o código do danihcv e tirei minha conclusão sobre. Como ele quer que o item tenha 30 cargas, basta usar atributos. Fica mais fácil. function onDeath(cid, corpse, deathList, lastHitKiller, mostDamageKiller) if isPlayer(cid) then if getPlayerSlotItem(cid, 2).itemid == 2173 then local v = getItemAttribute(getPlayerSlotItem(cid, 2).uid, "charges") or 0 if v < 29 then doCreatureSetDropLoot(cid, false) doPlayerSetLossSkill(cid, false) doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 10) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA) doItemSetAttribute(getPlayerSlotItem(cid, 2).uid, "charges", v + 1) else doRemoveItem(getPlayerSlotItem(cid, 2).uid) end end end return true end não respondo pms solicitando suporte em programação/scripting
Postado Dezembro 30, 2014 10 anos Faz um bom tempo que não scripteio, mas pelo que entendi da sua descrição, isso talvez baste. E eu não sei como esse AoL funciona (não jogo Tibia). Na verdade, só li o código do danihcv e tirei minha conclusão sobre. Como ele quer que o item tenha 30 cargas, basta usar atributos. Fica mais fácil. function onDeath(cid, corpse, deathList, lastHitKiller, mostDamageKiller) if isPlayer(cid) then if getPlayerSlotItem(cid, 2).itemid == 2173 then local v = getItemAttribute(getPlayerSlotItem(cid, 2).uid, "charges") or 0 if v < 29 then doCreatureSetDropLoot(cid, false) doPlayerSetLossSkill(cid, false) doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 10) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA) doItemSetAttribute(getPlayerSlotItem(cid, 2).uid, "charges", v + 1) else doRemoveItem(getPlayerSlotItem(cid, 2).uid) end end end return true end O certo não seria isso ? function onDeath(cid, corpse, deathList, lastHitKiller, mostDamageKiller) if isPlayer(cid) then if getPlayerSlotItem(cid, 2).itemid == 2173 then local v = getItemAttribute(getPlayerSlotItem(cid, 2).uid, "charges") or 0 if v >= 1 then doCreatureSetDropLoot(cid, false) --[[doPlayerSetLossSkill(cid, false) < não precisa pois aol não salva skill]] doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 10) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA) doItemSetAttribute(getPlayerSlotItem(cid, 2).uid, "charges", v - 1) else doRemoveItem(getPlayerSlotItem(cid, 2).uid) end end end return true end /\ Não sei se estou certo, mas, pode ser uma possibilidade pois não testei nada.@Edit Meu deus, odeio quando os Quote buga. Editado Dezembro 30, 2014 10 anos por Snowsz (veja o histórico de edições) _ .-'` `} _./) / } .'o \ | } '.___.'`.\ {` /`\_/ , `. } ME DA UMA NOZ! \=' .-' _`\ { `'`;/ `, } _\ @ ; } /__`;-...'--' Cluck!
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.