Ir para conteúdo
  • Cadastre-se

[SHOPP] Systen bugado!


Posts Recomendados

RESOLVI MEU PROBLEMA USEI ESSE shop.lua apaguei o meu e coloquei esse
 

  1. -- ### CONFIG ###
  2. -- time (in seconds) between connections to SQL database by shop script
  3. SQL_interval = 30
  4. -- ### END OF CONFIG ###
  5. function onThink(interval, lastExecution)
  6.     local result_plr = db.storeQuery("SELECT * FROM z_ots_comunication")
  7.     if result_plr ~= false then
  8.         repeat
  9.             local id = tonumber(result.getDataInt(result_plr, "id"))
  10.             local action = tostring(result.getDataString(result_plr, "action"))
  11.             local delete = tonumber(result.getDataInt(result_plr, "delete_it"))
  12.             local player = Player(tostring(result.getDataString(result_plr, "name")))
  13.             if player then
  14.                 local itemtogive_id = tonumber(result.getDataInt(result_plr, "param1"))
  15.                 local itemtogive_count = tonumber(result.getDataInt(result_plr, "param2"))
  16.                 local container_id = tonumber(result.getDataInt(result_plr, "param3"))
  17.                 local container_count = tonumber(result.getDataInt(result_plr, "param4"))
  18.                 local add_item_type = tostring(result.getDataString(result_plr, "param5"))
  19.                 local add_item_name = tostring(result.getDataString(result_plr, "param6"))
  20.                 local received_item = 0
  21.                 local full_weight = 0
  22.                 local itemType = ItemType(itemtogive_id)
  23.                 if add_item_type == 'container' then
  24.                     if itemType:isRune() then
  25.                         items_weight = container_count * itemType:getWeight()
  26.                     else
  27.                         items_weight = container_count * itemType:getWeight(itemtogive_count)
  28.                     end
  29.                     full_weight = items_weight + ItemType(container_id):getWeight()
  30.                 else
  31.                     if itemType:isRune() then
  32.                         full_weight = itemType:getWeight()
  33.                     else
  34.                         full_weight = itemType:getWeight(itemtogive_count)
  35.                     end
  36.                 end
  37.                 local free_cap = player:getFreeCapacity()
  38.                 if full_weight <= free_cap then
  39.                     if add_item_type == 'container' then
  40.                         local new_container = Game.createItem(container_id, 1)
  41.                         local iter = 0
  42.                         while iter ~= container_count do
  43.                             new_container:addItem(itemtogive_id, itemtogive_count)
  44.                             iter = iter + 1
  45.                         end
  46.                         received_item = player:addItemEx(new_container)
  47.                     else
  48.                         local new_item = Game.createItem(itemtogive_id, itemtogive_count)
  49.                         received_item = player:addItemEx(new_item)
  50.                     end
  51.                     if type(received_item) == 'number' and received_item == RETURNVALUE_NOERROR then
  52.                         player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'You received >> '.. add_item_name ..' << from OTS shop.')
  53.                         db.query("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";")
  54.                         db.query("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " ..id .. ";")
  55.                     else
  56.                         player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. Please make place for this item in your backpack/hands and wait about '.. SQL_interval ..' seconds to get it.')
  57.                     end
  58.                 else
  59.                     player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. It weight is '.. full_weight ..' oz., you have only '.. free_cap ..' oz. free capacity. Put some items in depot and wait about '.. SQL_interval..' seconds to get it.')
  60.                 end
  61.             end
  62.         until not result.next(result_plr)
  63.         result.free(result_plr)
  64.     end
  65.     return true
  66. end


e agora esta tudo 100%, topico resolvido
Link para o post
Compartilhar em outros sites
  • 1 month later...
  • Respostas 16
  • Created
  • Última resposta

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Veja os posts http://www.tibiaking.com/forum/topic/52485-gesior-entrega-itens-sem-parar/

Vou dar uma olhada no script... Certifica que ele ta dentro da pasta /globalevents/scripts/, copia ele la

-- ### CONFIG ### -- message send to player by script "type" (types you can check in "global.lua") SHOP_MSG_TYPE = 18 -- time (in seconds) between connections to SQL database by shop script SQL_interval = 30 -- ### END OF CONFIG ### function onThink(interval, lastExecution)     local result_plr = db.storeQuery("SELECT * FROM z_ots_comunication")     if(result_plr ~= false) then         repeat             local id = tonumber(result.getDataInt(result_plr, "id"))             local action = tostring

MUITO OBRIGA

  Em 17/10/2015 em 23:20, bunda321 disse:

RESOLVI MEU PROBLEMA USEI ESSE shop.lua apaguei o meu e coloquei esse
 

  1. -- ### CONFIG ###
  2. -- time (in seconds) between connections to SQL database by shop script
  3. SQL_interval = 30
  4. -- ### END OF CONFIG ###
  5. function onThink(interval, lastExecution)
  6.     local result_plr = db.storeQuery("SELECT * FROM z_ots_comunication")
  7.     if result_plr ~= false then
  8.         repeat
  9.             local id = tonumber(result.getDataInt(result_plr, "id"))
  10.             local action = tostring(result.getDataString(result_plr, "action"))
  11.             local delete = tonumber(result.getDataInt(result_plr, "delete_it"))
  12.             local player = Player(tostring(result.getDataString(result_plr, "name")))
  13.             if player then
  14.                 local itemtogive_id = tonumber(result.getDataInt(result_plr, "param1"))
  15.                 local itemtogive_count = tonumber(result.getDataInt(result_plr, "param2"))
  16.                 local container_id = tonumber(result.getDataInt(result_plr, "param3"))
  17.                 local container_count = tonumber(result.getDataInt(result_plr, "param4"))
  18.                 local add_item_type = tostring(result.getDataString(result_plr, "param5"))
  19.                 local add_item_name = tostring(result.getDataString(result_plr, "param6"))
  20.                 local received_item = 0
  21.                 local full_weight = 0
  22.                 local itemType = ItemType(itemtogive_id)
  23.                 if add_item_type == 'container' then
  24.                     if itemType:isRune() then
  25.                         items_weight = container_count * itemType:getWeight()
  26.                     else
  27.                         items_weight = container_count * itemType:getWeight(itemtogive_count)
  28.                     end
  29.                     full_weight = items_weight + ItemType(container_id):getWeight()
  30.                 else
  31.                     if itemType:isRune() then
  32.                         full_weight = itemType:getWeight()
  33.                     else
  34.                         full_weight = itemType:getWeight(itemtogive_count)
  35.                     end
  36.                 end
  37.                 local free_cap = player:getFreeCapacity()
  38.                 if full_weight <= free_cap then
  39.                     if add_item_type == 'container' then
  40.                         local new_container = Game.createItem(container_id, 1)
  41.                         local iter = 0
  42.                         while iter ~= container_count do
  43.                             new_container:addItem(itemtogive_id, itemtogive_count)
  44.                             iter = iter + 1
  45.                         end
  46.                         received_item = player:addItemEx(new_container)
  47.                     else
  48.                         local new_item = Game.createItem(itemtogive_id, itemtogive_count)
  49.                         received_item = player:addItemEx(new_item)
  50.                     end
  51.                     if type(received_item) == 'number' and received_item == RETURNVALUE_NOERROR then
  52.                         player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'You received >> '.. add_item_name ..' << from OTS shop.')
  53.                         db.query("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";")
  54.                         db.query("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " ..id .. ";")
  55.                     else
  56.                         player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. Please make place for this item in your backpack/hands and wait about '.. SQL_interval ..' seconds to get it.')
  57.                     end
  58.                 else
  59.                     player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. It weight is '.. full_weight ..' oz., you have only '.. free_cap ..' oz. free capacity. Put some items in depot and wait about '.. SQL_interval..' seconds to get it.')
  60.                 end
  61.             end
  62.         until not result.next(result_plr)
  63.         result.free(result_plr)
  64.     end
  65.     return true
  66. end

 


e agora esta tudo 100%, topico resolvido

 

Expand   Mostrar mais  

muito obrigado,resolveu meu problema aqui

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Estatísticas dos Fóruns

    96840
    Tópicos
    519577
    Posts



×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo