Ir para conteúdo

Featured Replies

Postado

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.
 

Mostrar conteúdo oculto 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 TRUE
end

local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false

function onThingMove(creature, thing, oldpos, oldstackpos)

end


function onCreatureAppear(creature)

end


function onCreatureDisappear(cid, pos)
      if focus == cid then
          selfSay('?????.')
          focus = 0
          talk_start = 0
      end
end


function onCreatureTurn(creature)

end


function msgcontains(txt, str)
      return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end


function onCreatureSay(cid, type, msg)
      msg = string.lower(msg)

      if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
    
    if getPlayerLevel(cid) >= 2001 then
selfSay('You cannot reborn, levels 2000 more not is possible.')
return false
end
        
            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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(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 then
setPlayerStorageValue(cid,30023,1)
            doReborn(cid, 1, 586, 581)    
talk_state = 0

elseif msgcontains(msg, 'yes') and talk_state == 2 then
selfSay('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
    end
end

function 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
     end
end

561d9e2a93bcf_Sem_ttulo.thumb.png.e7307c

Se puderem me ajudar agradeço.

 
Postado

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.lua
E a line 50 do script data/npc/scripts/reborn.lua

discord.pngDiscord: 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

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo