Postado Setembro 28, 2015 9 anos Em globalevents troque seu sistema de entrega por esse: Xml: <globalevent name="GuildShop" interval="30000" script="shopguild.lua"/> shopguild.lua: -- <globalevent name="GuildShop" interval="30000" script="shopguild.lua"/> function onThink(interval, lastExecution) local queryShop = db.storeQuery('SELECT * FROM `z_ots_guildcomunication`;') if queryShop ~= false then repeat local id, player = result.getNumber(queryShop, 'id'), Player(result.getString(queryShop, 'name')) if player then local item_id, item_count = result.getNumber(queryShop, 'param1'), result.getNumber(queryShop, 'param2') local container_id, container_count = result.getNumber(queryShop, 'param3'), result.getNumber(queryShop, 'param4') local offer_type = result.getString(queryShop, 'param5') local item_name = result.getString(queryShop, 'param6') -- ITEM if offer_type == 'item' then player:getInbox():addItem(item_id, item_count, INDEX_WHEREEVER, FLAG_NOLIMIT) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Voce recebeu >> '.. item_name ..' << do guild shop em seu depot.') -- CONTAINER elseif offer_type == 'container' then local container_id, container_count = result.getNumber(queryShop, 'param3'), result.getNumber(queryShop, 'param4') local i, new_container = 0, player:getInbox():addItem(container_id, 1, INDEX_WHEREEVER, FLAG_NOLIMIT) while i ~= container_count do new_container:addItem(item_id, item_count, INDEX_WHEREEVER, FLAG_NOLIMIT) i = i + 1 end player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Voce recebeu >> '.. item_name ..' << do guild shop em seu depot.') -- ADDON elseif offer_type == 'addon' then player:addOutfitAddon(item_id, 3) player:addOutfitAddon(item_count, 3) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Voce recebeu >> '.. item_name ..'<< do guild shop.') -- MOUNT elseif offer_type == 'mount' then player:addMount(item_id) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Voce recebeu >> '.. item_name ..' << do guild shop.') end db.asyncQuery('DELETE FROM `z_ots_guildcomunication` WHERE `id` = ' .. id) db.asyncQuery('UPDATE `z_shopguild_history_item` SET `trans_state` = \'realized\', `trans_real` = ' .. os.time() .. ' WHERE id = '..id..';') end until not result.next(queryShop) result.free(queryShop) end return true end _ .-'` `} _./) / } .'o \ | } '.___.'`.\ {` /`\_/ , `. } ME DA UMA NOZ! \=' .-' _`\ { `'`;/ `, } _\ @ ; } /__`;-...'--' Cluck!
Postado Setembro 28, 2015 9 anos Autor Não funcionou... Está dando um erro na distro agora: Não tenho muito conhecimento para resolver Desculpe estar tomando seu tempo, mas obrigado por tentar me ajudar
Postado Setembro 28, 2015 9 anos Tenta: -- <globalevent name="GuildShop" interval="30000" script="shopguild.lua"/> function onThink(interval, lastExecution) local queryShop = db.storeQuery('SELECT * FROM `z_ots_guildcomunication`;') if queryShop ~= false then repeat local id, player = tonumber(result.getString(queryShop, 'id')), Player(result.getString(queryShop, 'name')) if player then local item_id, item_count = tonumber(result.getString(queryShop, 'param1')), tonumber(result.getString(queryShop, 'param2')) local container_id, container_count = tonumber(result.getString(queryShop, 'param3')), tonumber(result.getString(queryShop, 'param4')) local offer_type = result.getString(queryShop, 'param5') local item_name = result.getString(queryShop, 'param6') -- ITEM if offer_type == 'item' then player:getInbox():addItem(item_id, item_count, INDEX_WHEREEVER, FLAG_NOLIMIT) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Voce recebeu >> '.. item_name ..' << do guild shop em seu depot.') -- CONTAINER elseif offer_type == 'container' then local container_id, container_count = result.getNumber(queryShop, 'param3'), result.getNumber(queryShop, 'param4') local i, new_container = 0, player:getInbox():addItem(container_id, 1, INDEX_WHEREEVER, FLAG_NOLIMIT) while i ~= container_count do new_container:addItem(item_id, item_count, INDEX_WHEREEVER, FLAG_NOLIMIT) i = i + 1 end player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Voce recebeu >> '.. item_name ..' << do guild shop em seu depot.') -- ADDON elseif offer_type == 'addon' then player:addOutfitAddon(item_id, 3) player:addOutfitAddon(item_count, 3) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Voce recebeu >> '.. item_name ..'<< do guild shop.') -- MOUNT elseif offer_type == 'mount' then player:addMount(item_id) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Voce recebeu >> '.. item_name ..' << do guild shop.') end db.asyncQuery('DELETE FROM `z_ots_guildcomunication` WHERE `id` = ' .. id) db.asyncQuery('UPDATE `z_shopguild_history_item` SET `trans_state` = \'realized\', `trans_real` = ' .. os.time() .. ' WHERE id = '..id..';') end until not result.next(queryShop) result.free(queryShop) end return true end Se não funcionar, vá na lib, e procure por um arquivo que contém o nome database ou parecido com esse e poste aqui. _ .-'` `} _./) / } .'o \ | } '.___.'`.\ {` /`\_/ , `. } ME DA UMA NOZ! \=' .-' _`\ { `'`;/ `, } _\ @ ; } /__`;-...'--' Cluck!
Postado Setembro 29, 2015 9 anos Autor Não funcionou, agora ta dando esse erro: E na minha pasta lib, isso é tudo o que tem la dentro: Qual deles é? D:
Postado Setembro 29, 2015 9 anos Não tem a lib... Essa vai ser minha última tentativa pois, não sei as funções certas de se lidar com query no tfs 1.0. -- <globalevent name="GuildShop" interval="30000" script="others/shopguild.lua"/> function onThink(interval, lastExecution) local queryShop = db.storeQuery('SELECT * FROM `z_ots_guildcomunication`;') if queryShop ~= false then repeat local id, player = result.getDataInt(queryShop, 'id'), Player(result.getDataString(queryShop, 'name')) if player then local item_id, item_count = result.getDataInt(queryShop, 'param1'), result.getDataInt(queryShop, 'param2') local container_id, container_count = result.getDataInt(queryShop, 'param3'), result.getDataInt(queryShop, 'param4') local offer_type = result.getDataString(queryShop, 'param5') local item_name = result.getDataString(queryShop, 'param6') -- ITEM if offer_type == 'item' then player:getInbox():addItem(item_id, item_count, INDEX_WHEREEVER, FLAG_NOLIMIT) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Voce recebeu >> '.. item_name ..' << do guild shop em seu depot.') -- CONTAINER elseif offer_type == 'container' then local container_id, container_count = result.getDataInt(queryShop, 'param3'), result.getDataInt(queryShop, 'param4') local i, new_container = 0, player:getInbox():addItem(container_id, 1, INDEX_WHEREEVER, FLAG_NOLIMIT) while i ~= container_count do new_container:addItem(item_id, item_count, INDEX_WHEREEVER, FLAG_NOLIMIT) i = i + 1 end player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Voce recebeu >> '.. item_name ..' << do guild shop em seu depot.') -- ADDON elseif offer_type == 'addon' then player:addOutfitAddon(item_id, 3) player:addOutfitAddon(item_count, 3) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Voce recebeu >> '.. item_name ..'<< do guild shop.') -- MOUNT elseif offer_type == 'mount' then player:addMount(item_id) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Voce recebeu >> '.. item_name ..' << do guild shop.') end db.asyncQuery('DELETE FROM `z_ots_guildcomunication` WHERE `id` = ' .. id) db.asyncQuery('UPDATE `z_shopguild_history_item` SET `trans_state` = \'realized\', `trans_real` = ' .. os.time() .. ' WHERE id = '..id..';') end until not result.next(queryShop) result.free(queryShop) end return true end _ .-'` `} _./) / } .'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.