Postado Março 29, 2017 8 anos Autor Em 27/03/2017 ás 01:04, KotZletY disse: @Juantibiano troque seu heart por esse: local t = { [{100,800}] = 5943, [{2001,3000}] = 2353, [{3001,4000}] = 1685, [{4001,5000}] = 11361, [{5001,6000}] = 10552, [{6001,math.huge}] = 10577 } local function getHeartFromNivel(uid) local k = false for var, ret in pairs(t) do if getPlayerLevel(uid) >= var[1] and getPlayerLevel(uid) <= var[2] then k = ret end end return k end function onDeath(cid, corpse, deathList) if isPlayer(deathList[1]) and getPlayerLevel(cid) >= 100 then local item = getHeartFromNivel(cid) if item then doItemSetAttribute(doPlayerAddItem(deathList[1],item, 1), "description", "This is the heart of "..getPlayerName(cid).." killed at Level "..getPlayerLevel(cid).." by "..getPlayerName(deathList[1])..".") doSendMagicEffect(getPlayerPosition(deathList[1]), 12) end end return true end Desculpe a demora para voltar, estive sem tempo. Obrigado por colaborar. O sistema de heart funciona perfeitamente (como antes) mas o corpo do player ainda continua sem aparecer ao morrer :\
Postado Março 30, 2017 8 anos @Juantibiano teste assim, mudei apenas o callback: Spoiler local t = { [{100,800}] = 5943, [{2001,3000}] = 2353, [{3001,4000}] = 1685, [{4001,5000}] = 11361, [{5001,6000}] = 10552, [{6001,math.huge}] = 10577 } local function getHeartFromNivel(uid) local k = false for var, ret in pairs(t) do if getPlayerLevel(uid) >= var[1] and getPlayerLevel(uid) <= var[2] then k = ret end end return k end function onKill(cid, target) if isPlayer(cid) and getPlayerLevel(target) >= 100 then local item = getHeartFromNivel(target) if item then doItemSetAttribute(doPlayerAddItem(cid,item, 1), "description", "This is the heart of "..getPlayerName(target).." killed at Level "..getPlayerLevel(target).." by "..getPlayerName(cid)..".") doSendMagicEffect(getPlayerPosition(cid), 12) end end return true end precisará que mude também a tag xml, <event type="kill" name="Heart" event="script" value="heart.lua"/> não esqueça de registrar o nome do event, escrito na tag name, no login.lua!
Postado Abril 2, 2017 8 anos Autor Em 30/03/2017 ás 16:41, KotZletY disse: @Juantibiano teste assim, mudei apenas o callback: Mostrar conteúdo oculto local t = { [{100,800}] = 5943, [{2001,3000}] = 2353, [{3001,4000}] = 1685, [{4001,5000}] = 11361, [{5001,6000}] = 10552, [{6001,math.huge}] = 10577 } local function getHeartFromNivel(uid) local k = false for var, ret in pairs(t) do if getPlayerLevel(uid) >= var[1] and getPlayerLevel(uid) <= var[2] then k = ret end end return k end function onKill(cid, target) if isPlayer(cid) and getPlayerLevel(target) >= 100 then local item = getHeartFromNivel(target) if item then doItemSetAttribute(doPlayerAddItem(cid,item, 1), "description", "This is the heart of "..getPlayerName(target).." killed at Level "..getPlayerLevel(target).." by "..getPlayerName(cid)..".") doSendMagicEffect(getPlayerPosition(cid), 12) end end return true end precisará que mude também a tag xml, <event type="kill" name="Heart" event="script" value="heart.lua"/> não esqueça de registrar o nome do event, escrito na tag name, no login.lua! infelizmente nada cara, seu sistema ta 100% dando o coração na bag após matar. Mas o corpo que é bom nada :\ Se voce puder continuar dando dicas estou aberto, porque é uma coisa q nao pode faltar no servidor isso.
Postado Abril 2, 2017 8 anos @Juantibiano se isso não der certo, não sei o pode está acontecendo de errado. Spoiler local table = { [1] = 2813, --- [1] Vocation 2882 == ID Do Corpse [2] = 2813, [3] = 2813, [4] = 2813, [5] = 2813, [6] = 2813, [7] = 2813, [8] = 2813, [9] = 2813, [10] = 2813, [11] = 2813, [12] = 2813, [13] = 2813, [14] = 2813, [15] = 2813, [16] = 2813, [17] = 2807, ---Sasuke Uchiha ---- [18] = 2807, [19] = 2807, [20] = 2807, [21] = 2807, [22] = 2807, [23] = 2807, [24] = 2807, [25] = 2807, [26] = 2807, [257] = 2807, [27] = 2890, --- Rock Lee --- [28] = 2890, [29] = 2890, [30] = 2890, [31] = 2890, [32] = 2890, [33] = 2890, [34] = 2890, [35] = 2890, [36] = 2890, [37] = 2890, [38] = 2890, [39] = 2890, --- Shikamaru --- [40] = 2890, [41] = 2890, [42] = 2890, [43] = 2890, [44] = 2890, [45] = 2890, [46] = 2899, --- Neji --- [47] = 2899, [48] = 2899, [49] = 2899, [50] = 2899, [51] = 2899, [52] = 2899, [53] = 2899, [54] = 2899, [55] = 2829, ---Tenten --- [56] = 2829, [57] = 2829, [58] = 2829, [59] = 2829, [60] = 2829, [61] = 2829, [62] = 2829, [63] = 2829, [64] = 2816, --- Hinata --- [65] = 2816, [66] = 2816, [67] = 2816, [68] = 2816, [69] = 2816, [70] = 2816, [71] = 2816, [72] = 2816, [73] = 2816, [74] = 2816, [75] = 2816, [76] = 2852, --- KaKaShi HaTaKi --- [77] = 2852, [78] = 2852, [79] = 2852, [80] = 2852, [81] = 2852, [82] = 2852, [83] = 2852, [84] = 2932, --- KiLLeR Bee --- [85] = 2932, [86] = 2932, [87] = 2932, [88] = 2932, [89] = 2932, [90] = 2932, [91] = 2932, [92] = 2932, [93] = 2932, [94] = 2932, [95] = 2932, [96] = 2917, --- SaKuRa HaRuNo --- [97] = 2917, [98] = 2917, [99] = 2917, [100] = 2917, [102] = 2917, [103] = 2917, [104] = 2917, [105] = 2917, [106] = 2917, [107] = 2917, [108] = 2917, [109] = 2917, [110] = 2917, [101] = 2917, [111] = 2887, --- GaaRa Do DeSerTo --- [112] = 2887, [113] = 2887, [114] = 2887, [115] = 2887, [116] = 2887, [117] = 2887, [118] = 2887, [119] = 2887, [120] = 2887, [121] = 2887, [122] = 2887, [123] = 2891, --- Kiba InoZuKa --- [124] = 2891, [125] = 2891, [126] = 2891, [127] = 2891, [128] = 2891, [129] = 2891, [130] = 2891, [131] = 2891, [132] = 2898, --- ItaChI UchiHa --- [133] = 2898, [134] = 2898, [135] = 2898, [136] = 2898, [137] = 2898, [138] = 2898, [139] = 2898, [140] = 2898, [141] = 2898, [142] = 2888, --- ToBi UchiHa --- [143] = 2888, [144] = 2888, [145] = 2888, [146] = 2888, [147] = 2888, [148] = 2888, [149] = 2888, [150] = 2888, [151] = 2888, [152] = 2888, [153] = 2888, [154] = 2912, --- MiNaTo [155] = 2912, [156] = 2912, [157] = 2912, [158] = 2912, [159] = 2912, [160] = 2912, [161] = 2912, [162] = 2912, [163] = 2912, [164] = 3281, --- Madara Uchiha --- [165] = 3281, [166] = 3281, [167] = 3281, [168] = 3281, [169] = 3281, [170] = 3281, [171] = 3281, [172] = 3281, [173] = 3281, [174] = 3281, [175] = 2922, --- TsuNaDe --- [176] = 2922, [177] = 2922, [178] = 2922, [179] = 2922, [180] = 2922, [181] = 2922, [182] = 2922, [183] = 2922, [184] = 2922, [185] = 2922, [186] = 2907, --- HaShiRaMa [187] = 2907, [188] = 2907, [189] = 2907, [190] = 2907, [191] = 2907, [192] = 2907, [193] = 2937, --- NiDaiMe --- [194] = 2937, [195] = 2937, [196] = 2937, [197] = 2937, [198] = 2937, [199] = 2937, [200] = 2940, --- NaGaTo --- [201] = 2940, [202] = 2940, [203] = 2940, [204] = 2940, [205] = 2940, [206] = 2940, [207] = 2940, [208] = 2940, [209] = 2940, [210] = 2940, [211] = 2841, --- Yamato --- [212] = 2841, [213] = 2841, [214] = 2841, [215] = 2841, [216] = 2841, [217] = 2932, --- RaiKaGe [218] = 2932, [219] = 2932, [220] = 2932, [221] = 2932, [222] = 2932, [223] = 2889, --- KiSaMe --- [224] = 2889, [225] = 2889, [226] = 2889, [227] = 2889, [228] = 2889, [229] = 2889, [230] = 2889, [231] = 2894, --- TeMaRi --- [232] = 2894, [233] = 2894, [234] = 2894, [235] = 2894, [236] = 2894, [237] = 2894, [238] = 2894, [238] = 2894 } local function transform(pos, id, voc) local item = getTileItemById(pos, id) if item and item.uid > 1 then doTransformItem(item.uid, table[voc]) doDecayItem(item.uid or 0) end end function onDeath(cid, corpse) if isPlayer(cid) and table[getPlayerVocation(cid)] then addEvent(transform, 15, getThingPos(cid), corpse.itemid, getPlayerVocation(cid)) end return true end Existe algum outro sistema no seu servidor usando o callback onDeath ? Talvez deva a ver alguma interferência, algo deva está retornando incorretamente os param do callback. Revise o mesmo!
Postado Abril 2, 2017 8 anos Autor 55 minutos atrás, KotZletY disse: @Juantibiano se isso não der certo, não sei o pode está acontecendo de errado. Mostrar conteúdo oculto local table = { [1] = 2813, --- [1] Vocation 2882 == ID Do Corpse [2] = 2813, [3] = 2813, [4] = 2813, [5] = 2813, [6] = 2813, [7] = 2813, [8] = 2813, [9] = 2813, [10] = 2813, [11] = 2813, [12] = 2813, [13] = 2813, [14] = 2813, [15] = 2813, [16] = 2813, [17] = 2807, ---Sasuke Uchiha ---- [18] = 2807, [19] = 2807, [20] = 2807, [21] = 2807, [22] = 2807, [23] = 2807, [24] = 2807, [25] = 2807, [26] = 2807, [257] = 2807, [27] = 2890, --- Rock Lee --- [28] = 2890, [29] = 2890, [30] = 2890, [31] = 2890, [32] = 2890, [33] = 2890, [34] = 2890, [35] = 2890, [36] = 2890, [37] = 2890, [38] = 2890, [39] = 2890, --- Shikamaru --- [40] = 2890, [41] = 2890, [42] = 2890, [43] = 2890, [44] = 2890, [45] = 2890, [46] = 2899, --- Neji --- [47] = 2899, [48] = 2899, [49] = 2899, [50] = 2899, [51] = 2899, [52] = 2899, [53] = 2899, [54] = 2899, [55] = 2829, ---Tenten --- [56] = 2829, [57] = 2829, [58] = 2829, [59] = 2829, [60] = 2829, [61] = 2829, [62] = 2829, [63] = 2829, [64] = 2816, --- Hinata --- [65] = 2816, [66] = 2816, [67] = 2816, [68] = 2816, [69] = 2816, [70] = 2816, [71] = 2816, [72] = 2816, [73] = 2816, [74] = 2816, [75] = 2816, [76] = 2852, --- KaKaShi HaTaKi --- [77] = 2852, [78] = 2852, [79] = 2852, [80] = 2852, [81] = 2852, [82] = 2852, [83] = 2852, [84] = 2932, --- KiLLeR Bee --- [85] = 2932, [86] = 2932, [87] = 2932, [88] = 2932, [89] = 2932, [90] = 2932, [91] = 2932, [92] = 2932, [93] = 2932, [94] = 2932, [95] = 2932, [96] = 2917, --- SaKuRa HaRuNo --- [97] = 2917, [98] = 2917, [99] = 2917, [100] = 2917, [102] = 2917, [103] = 2917, [104] = 2917, [105] = 2917, [106] = 2917, [107] = 2917, [108] = 2917, [109] = 2917, [110] = 2917, [101] = 2917, [111] = 2887, --- GaaRa Do DeSerTo --- [112] = 2887, [113] = 2887, [114] = 2887, [115] = 2887, [116] = 2887, [117] = 2887, [118] = 2887, [119] = 2887, [120] = 2887, [121] = 2887, [122] = 2887, [123] = 2891, --- Kiba InoZuKa --- [124] = 2891, [125] = 2891, [126] = 2891, [127] = 2891, [128] = 2891, [129] = 2891, [130] = 2891, [131] = 2891, [132] = 2898, --- ItaChI UchiHa --- [133] = 2898, [134] = 2898, [135] = 2898, [136] = 2898, [137] = 2898, [138] = 2898, [139] = 2898, [140] = 2898, [141] = 2898, [142] = 2888, --- ToBi UchiHa --- [143] = 2888, [144] = 2888, [145] = 2888, [146] = 2888, [147] = 2888, [148] = 2888, [149] = 2888, [150] = 2888, [151] = 2888, [152] = 2888, [153] = 2888, [154] = 2912, --- MiNaTo [155] = 2912, [156] = 2912, [157] = 2912, [158] = 2912, [159] = 2912, [160] = 2912, [161] = 2912, [162] = 2912, [163] = 2912, [164] = 3281, --- Madara Uchiha --- [165] = 3281, [166] = 3281, [167] = 3281, [168] = 3281, [169] = 3281, [170] = 3281, [171] = 3281, [172] = 3281, [173] = 3281, [174] = 3281, [175] = 2922, --- TsuNaDe --- [176] = 2922, [177] = 2922, [178] = 2922, [179] = 2922, [180] = 2922, [181] = 2922, [182] = 2922, [183] = 2922, [184] = 2922, [185] = 2922, [186] = 2907, --- HaShiRaMa [187] = 2907, [188] = 2907, [189] = 2907, [190] = 2907, [191] = 2907, [192] = 2907, [193] = 2937, --- NiDaiMe --- [194] = 2937, [195] = 2937, [196] = 2937, [197] = 2937, [198] = 2937, [199] = 2937, [200] = 2940, --- NaGaTo --- [201] = 2940, [202] = 2940, [203] = 2940, [204] = 2940, [205] = 2940, [206] = 2940, [207] = 2940, [208] = 2940, [209] = 2940, [210] = 2940, [211] = 2841, --- Yamato --- [212] = 2841, [213] = 2841, [214] = 2841, [215] = 2841, [216] = 2841, [217] = 2932, --- RaiKaGe [218] = 2932, [219] = 2932, [220] = 2932, [221] = 2932, [222] = 2932, [223] = 2889, --- KiSaMe --- [224] = 2889, [225] = 2889, [226] = 2889, [227] = 2889, [228] = 2889, [229] = 2889, [230] = 2889, [231] = 2894, --- TeMaRi --- [232] = 2894, [233] = 2894, [234] = 2894, [235] = 2894, [236] = 2894, [237] = 2894, [238] = 2894, [238] = 2894 } local function transform(pos, id, voc) local item = getTileItemById(pos, id) if item and item.uid > 1 then doTransformItem(item.uid, table[voc]) doDecayItem(item.uid or 0) end end function onDeath(cid, corpse) if isPlayer(cid) and table[getPlayerVocation(cid)] then addEvent(transform, 15, getThingPos(cid), corpse.itemid, getPlayerVocation(cid)) end return true end Existe algum outro sistema no seu servidor usando o callback onDeath ? Talvez deva a ver alguma interferência, algo deva está retornando incorretamente os param do callback. Revise o mesmo! tava analisando isso hoje, mas nao vi com calma, vou ver aqui e deixo a resposta para você amanha. Caso eu ache a solução posto aqui no tópico. Obrigado pelo suporte.
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.