Postado Outubro 14, 2015 10 anos Boa noite,Gostaria de ajuda no seguinte script npc reborn 8.6 está dando erro na Lib na hora de rebornar...olhei alguns foruns e tentei mudar de db.executequery para db.query e nao mudou. function doReborn(cid, level, looktype, vocation)setGlobalStorageValue(1000,getPlayerGUID(cid))doRemoveCreature(cid)db.executeQuery("UPDATE `players` SET `level` = " .. level .. " WHERE `id` = " .. getGlobalStorageValue(1000) .. ";")db.executeQuery("UPDATE `players` SET `looktype` = " .. looktype .. " WHERE `id` = " .. getGlobalStorageValue(1000) .. ";")db.executeQuery("UPDATE `players` SET `vocation` = " .. vocation .. " WHERE `id` = " .. getGlobalStorageValue(1000) .. ";")return TRUEendlocal focus = 0local talk_start = 0local target = 0local following = falselocal attacking = falsefunction onThingMove(creature, thing, oldpos, oldstackpos)endfunction onCreatureAppear(creature)endfunction onCreatureDisappear(cid, pos) if focus == cid then selfSay('?????.') focus = 0 talk_start = 0 endendfunction onCreatureTurn(creature)endfunction msgcontains(txt, str) return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))endfunction onCreatureSay(cid, type, msg) msg = string.lower(msg) if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then if getPlayerLevel(cid) >= 2001 thenselfSay('You cannot reborn, levels 2000 more not is possible.')return falseend selfSay('Hello. If you ready I can "Reborn" you.') focus = cid talk_start = os.clock() elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('Sorry, ' .. getCreatureName(cid) .. '! Hey!.') elseif focus == cid then talk_start = os.clock()if msgcontains(msg, 'reborn') and getPlayerStorageValue(cid,30023) == 4 then selfSay('Sorry, but you are after reborn.') focus = 0 talk_start = 0 elseif msgcontains(msg, 'reborn') and getPlayerLevel(cid) < 250 and getPlayerStorageValue(cid,30023) ~= 4 then selfSay('Hehe, I say If you READY. You do not have 250 lvl.') elseif msgcontains(msg, 'reborn') then selfSay('Are you sure?') talk_state = 2 --Goku-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 1 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 10, 211)talk_state = 0--Vegeta-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 8 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 26, 221) talk_state = 0--Piccolo-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 92 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 38, 231) talk_state = 0--C17-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 20 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 46, 241) talk_state = 0--Gohan-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 25 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 64, 251) talk_state = 0--Mirai Trunks-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 32 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 74, 261) talk_state = 0--Cell-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 38 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 81, 271) talk_state = 0--Freeza-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 43 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 88, 281) talk_state = 0--Buu-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 50 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 98, 291) talk_state = 0--Broly-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 57 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 113, 301) talk_state = 0--C18-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 62 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 46, 311) talk_state = 0--Uub-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 67 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 128, 321) talk_state = 0--Goten-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 72 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 142, 331) talk_state = 0--Chibi Trunks-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 79 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 151, 597) talk_state = 0--Cooler-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 86 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 153, 351) talk_state = 0--Dende-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 92 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 169, 361) talk_state = 0--Baby-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 97 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 580, 371) talk_state = 0--Bardock-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 102 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 188, 381) talk_state = 0--Kuririn-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 108 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 205, 391) talk_state = 0--Pan-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 113 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 212, 401) talk_state = 0--Videl-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 118 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 227, 411) talk_state = 0--Janemba--- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 123 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 234, 421) talk_state = 0--Tenshihan-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 128 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 246, 431) talk_state = 0--Jenk-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 133 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 257, 441) talk_state = 0--Raditz-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 138 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 267, 451) talk_state = 0--C16-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 143 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 272, 461) talk_state = 0--Turles-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 148 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 285, 471) talk_state = 0--Bulma-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 153 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 296, 481) talk_state = 0--Shenron-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 158 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 302, 491) talk_state = 0--Vegetto-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 163 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 308, 501) talk_state = 0--Tapion-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 168 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 321, 511) talk_state = 0--Kame-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 173 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 331, 521) talk_state = 0--Kagome-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 178 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 357, 531) talk_state = 0--King Vegeta-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 183 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 347, 541) talk_state = 0--Zaiko-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 188 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 368, 551) talk_state = 0--Chilled--- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 193 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 375, 561) talk_state = 0-C8-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 198 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 516, 571) talk_state = 0--Bills-- elseif msgcontains(msg, 'yes') and talk_state == 2 and getPlayerLevel(cid) <= 604 and getPlayerLevel(cid) >= 250 and getPlayerVocation(cid) == 203 thensetPlayerStorageValue(cid,30023,1) doReborn(cid, 1, 586, 581) talk_state = 0elseif msgcontains(msg, 'yes') and talk_state == 2 thenselfSay('Sorry, ' .. getCreatureName(cid) .. '! You must revert or transform.') elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then selfSay('Good bye.') focus = 0 talk_start = 0 end endendfunction onThink() doNpcSetCreatureFocus(focus) if (os.clock() - talk_start) > 45 then if focus > 0 then selfSay('Next Please...') end focus = 0 end if focus ~= 0 then if getDistanceToCreature(focus) > 5 then selfSay('Good bye then.') focus = 0 end endend Se puderem me ajudar agradeço.
Postado Outubro 14, 2015 10 anos Esse erro do SQLITE, esta me dando nervoso, remove o script do globalevents para checar o shop_history.Poderia postar a linha 721 do 050-function.luaE a line 50 do script data/npc/scripts/reborn.lua Discord: vankk #7765 Precisando de ajuda? Entre em contato comigo via Discord. Muitos vêm seus muitos dias de glória, mas poucos vêm seus muitos dias de luta.
Postado Outubro 14, 2015 10 anos Uma dúvida, você usa sqlite ou mysql?Se for sqlite > database > Open SQL query editor: DROP TABLE IF EXISTS z_shop_history_item; CREATE TABLE z_shop_history_item ( id INT( 11 ) NOT NULL, to_name VARCHAR( 255 ) NOT NULL DEFAULT '0', to_account INT( 11 ) NOT NULL DEFAULT '0', from_nick VARCHAR( 255 ) NOT NULL, from_account INT( 11 ) NOT NULL DEFAULT '0', price INT( 11 ) NOT NULL DEFAULT '0', offer_id VARCHAR( 255 ) NOT NULL DEFAULT '', trans_state VARCHAR( 255 ) NOT NULL, trans_start INT( 11 ) NOT NULL DEFAULT '0', trans_real INT( 11 ) NOT NULL DEFAULT '0', PRIMARY KEY ( id ) ); Se for mysql:DROP TABLE IF EXISTS `z_shop_history_item`; CREATE TABLE IF NOT EXISTS `z_shop_history_item` ( `id` int(11) NOT NULL AUTO_INCREMENT, `to_name` varchar(255) NOT NULL DEFAULT '0', `to_account` int(11) NOT NULL DEFAULT '0', `from_nick` varchar(255) NOT NULL, `from_account` int(11) NOT NULL DEFAULT '0', `price` int(11) NOT NULL DEFAULT '0', `offer_id` varchar(255) NOT NULL DEFAULT '', `trans_state` varchar(255) NOT NULL, `trans_start` int(11) NOT NULL DEFAULT '0', `trans_real` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; ___________________________________________________ SQLITE:DROP TABLE IF EXISTS z_shop_history_pacc; CREATE TABLE z_shop_history_pacc ( id INT( 11 ) NOT NULL, to_name VARCHAR( 255 ) NOT NULL DEFAULT '0', to_account INT( 11 ) NOT NULL DEFAULT '0', from_nick VARCHAR( 255 ) NOT NULL, from_account INT( 11 ) NOT NULL DEFAULT '0', price INT( 11 ) NOT NULL DEFAULT '0', pacc_days INT( 11 ) NOT NULL DEFAULT '0', trans_state VARCHAR( 255 ) NOT NULL, trans_start INT( 11 ) NOT NULL DEFAULT '0', trans_real INT( 11 ) NOT NULL DEFAULT '0', PRIMARY KEY ( id ) ); MYSQL:DROP TABLE IF EXISTS `z_shop_history_pacc`; CREATE TABLE IF NOT EXISTS `z_shop_history_pacc` ( `id` int(11) NOT NULL AUTO_INCREMENT, `to_name` varchar(255) NOT NULL DEFAULT '0', `to_account` int(11) NOT NULL DEFAULT '0', `from_nick` varchar(255) NOT NULL, `from_account` int(11) NOT NULL DEFAULT '0', `price` int(11) NOT NULL DEFAULT '0', `pacc_days` int(11) NOT NULL DEFAULT '0', `trans_state` varchar(255) NOT NULL, `trans_start` int(11) NOT NULL DEFAULT '0', `trans_real` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;Veja se saiu o erro.
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.