Postado Março 6, 2019 6 anos Fala gente beleza estou com um problema e gostaria de ajuda pois não sei o que esta acontecendo, o problema é o seguinte eu estou criando um server de WODBO mais acontece o seguinte toda vez que tento comprar do site algum item VIP OU VOCAÇÃO VIP o site confirma mais não chega no jogo.SEGUEM A PRINT PRA VEREM O ERRO... Aqui é a confirmação do SITE Error que aparece na Distro
Postado Março 7, 2019 6 anos Poste o script do shop... ╔══════════════════════════ҳ̸Ҳ̸ҳஜ۩۞۩ஜҳ̸Ҳ̸ҳ══════════════════════════╗ Te Ajudei? Rep + e ficamos Quits Precisando de ajuda? Discord: Yan Liima #3702 Programador Júnior de LUA, PHP e JavaScript Juntos somos lendas, separados somos Mitos! ╚══════════════════════════ҳ̸Ҳ̸ҳஜ۩۞۩ஜҳ̸Ҳ̸ҳ═════════════════════════════╝
Postado Março 7, 2019 6 anos Autor Certo aqui Citar local SHOP_MSG_TYPE = MESSAGE_EVENT_ORANGE local SQL_interval = 30 function onThink(interval, lastExecution) local result_plr = db.getResult("SELECT * FROM z_ots_comunication WHERE `type` = 'login';") if(result_plr:getID() ~= -1) then while(true) do local id = tonumber(result_plr:getDataInt("id")) local action = tostring(result_plr:getDataString("action")) local delete = tonumber(result_plr:getDataInt("delete_it")) local cid = getCreatureByName(tostring(result_plr:getDataString("name"))) if isPlayer(cid) then local itemtogive_id = tonumber(result_plr:getDataInt("param1")) local itemtogive_count = tonumber(result_plr:getDataInt("param2")) local container_id = tonumber(result_plr:getDataInt("param3")) local container_count = tonumber(result_plr:getDataInt("param4")) local add_item_type = tostring(result_plr:getDataString("param5")) local add_item_name = tostring(result_plr:getDataString("param6")) local received_item = 0 local full_weight = 0 if add_item_type == 'container' then container_weight = getItemWeightById(container_id, 1) if isItemRune(itemtogive_id) == TRUE then items_weight = container_count * getItemWeightById(itemtogive_id, 1) else items_weight = container_count * getItemWeightById(itemtogive_id, itemtogive_count) end full_weight = items_weight + container_weight else full_weight = getItemWeightById(itemtogive_id, itemtogive_count) if isItemRune(itemtogive_id) == TRUE then full_weight = getItemWeightById(itemtogive_id, 1) else full_weight = getItemWeightById(itemtogive_id, itemtogive_count) end end local free_cap = getPlayerFreeCap(cid) if full_weight <= free_cap then if add_item_type == 'container' then local new_container = doCreateItemEx(container_id, 1) local iter = 0 while iter ~= container_count do doAddContainerItem(new_container, itemtogive_id, itemtogive_count) iter = iter + 1 end received_item = doPlayerAddItemEx(cid, new_container) else local new_item = doCreateItemEx(itemtogive_id, itemtogive_count) doItemSetAttribute(new_item, "description", "Este item foi comprado pelo shop e entregue para o jogador ".. getPlayerName(cid) .."!") doItemSetAttribute(new_item, "aid", getPlayerGUID(cid)+10000) received_item = doPlayerAddItemEx(cid, new_item) end if received_item == RETURNVALUE_NOERROR then doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from OTS shop.') db.query("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";") db.query("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";") else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. 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.') end else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. 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.') end end if not(result_plr:next()) then break end end result_plr:free() end return true end
Postado Março 10, 2019 6 anos Em 06/03/2019 em 20:53, JoNe Away disse: Fala gente beleza estou com um problema e gostaria de ajuda pois não sei o que esta acontecendo, o problema é o seguinte eu estou criando um server de WODBO mais acontece o seguinte toda vez que tento comprar do site algum item VIP OU VOCAÇÃO VIP o site confirma mais não chega no jogo.SEGUEM A PRINT PRA VEREM O ERRO... Aqui é a confirmação do SITE Error que aparece na Distro Deixa eu ver, então Vai em globalevents/scripts/shop.lua copia tudo de lá, e coloca esse: Spoiler function onThink(interval, lastExecution, thinkInterval) local result = db.getResult("SELECT * FROM shop_history WHERE processed = 0;") if(result:getID() ~= -1) then while(true) do cid = getCreatureByName(tostring(result:getDataString("player"))) product = tonumber(result:getDataInt("product")) itemr = db.getResult("SELECT * FROM shop_offer WHERE id = "..product..";") if isPlayer(cid) then local id = tonumber(itemr:getDataInt("item")) local tid = tonumber(result:getDataInt("id")) local count = tonumber(itemr:getDataInt("count")) local tipe = tonumber(itemr:getDataInt("type")) local productn = tostring(itemr:getDataString("name")) if isInArray({5,8},tipe) then if getPlayerFreeCap(cid) >= getItemWeightById(id, count) then if isContainer(getPlayerSlotItem(cid, 3).uid) then received = doAddContainerItem(getPlayerSlotItem(cid, 3).uid, id,count) if received then doPlayerSendTextMessage(cid,19, "Você Recebeu Uma >> "..productn.." << do Shop System") db.executeQuery("UPDATE shop_history SET `processed`='1' WHERE id = " .. tid .. ";") else doPlayerSendTextMessage(cid,19, "Desculpa, Você não tem espaço para receber o item >> "..productn.." <<") end else doPlayerSendTextMessage(cid,19, "Desculpa, Você não tem espaço para receber >> "..productn.." <<") end else doPlayerSendTextMessage(cid,19, "Desculpa, você não tem cap para receber >> "..productn.." << (You need: "..getItemWeightById(id, count).." Capacity)") end elseif isInArray({6,7},tipe) then if tipe == 6 then bcap = 8 bid = 1987 elseif tipe == 7 then bcap = 20 bid = 1988 end if isItemRune(id) then count = 1 end if getPlayerFreeCap(cid) >= (getItemWeightById(1987, 1) + getItemWeightById(id,count * bcap)) then local bag = doCreateItemEx(bid, 1) for i = 1,bcap do doAddContainerItem(bag, id, count) end received = doPlayerAddItemEx(getPlayerSlotItem(cid, 3).uid, bag) if received == RETURNVALUE_NOERROR then doPlayerSendTextMessage(cid,19, "You have received >> "..productn.." << from our shop system") db.executeQuery("UPDATE shop_history SET `processed`='1' WHERE id = " .. tid .. ";") else doPlayerSendTextMessage(cid,19, "Sorry, you don't have enough space to receive >> "..productn.." <<") end else doPlayerSendTextMessage(cid,19, "Sorry, you don't have enough capacity to receive >> "..productn.." << (You need: "..getItemWeightById(id, count).." Capacity)") end end end itemr:free() if not(result:next()) then break end end result:free() end return true end Em 06/03/2019 em 21:22, JoNe Away disse: Certo aqui Spoiler function onThink(interval, lastExecution, thinkInterval) local result = db.getResult("SELECT * FROM shop_history WHERE `processed` = 0;") if(result:getID() ~= -1) then while(true) do cid = getCreatureByName(tostring(result:getDataString("player"))) product = tonumber(result:getDataInt("product")) itemr = db.getResult("SELECT * FROM shop_offer WHERE `id` = "..product..";") if isPlayer(cid) then local id = tonumber(itemr:getDataInt("item")) local tid = tonumber(result:getDataInt("id")) local count = tonumber(itemr:getDataInt("count")) local tipe = tonumber(itemr:getDataInt("type")) local productn = tostring(itemr:getDataString("name")) if isInArray({5,8},tipe) then if getPlayerFreeCap(cid) >= getItemWeightById(id, count) then if isContainer(getPlayerSlotItem(cid, 3).uid) then received = doAddContainerItem(getPlayerSlotItem(cid, 3).uid, id,count) if received then doPlayerSendTextMessage(cid,19, "Voce recebeu >> "..productn.." << de seu Shop System.") db.query("UPDATE `shop_history` SET `processed`='1' WHERE id = " .. tid .. ";") else doPlayerSendTextMessage(cid,19, "Desculpe, voce não tem nenhum espaço na bp para receber >> "..productn.." <<") end else doPlayerSendTextMessage(cid,19, "Desculpe, voce não tem nenhuma bp para receber >> "..productn.." <<") end else doPlayerSendTextMessage(cid,19, "Desculpe, voce não tem cap suficiente para receber >> "..productn.." << (Voce precisa de: "..getItemWeightById(id, count).." de cap.)") end elseif isInArray({6,7},tipe) then if tipe == 6 then bcap = 8 bid = 1987 elseif tipe == 7 then bcap = 20 bid = 1988 end if getPlayerFreeCap(cid) >= 5000 then local bag = doCreateItemEx(bid, 1) for i = 1,bcap do doAddContainerItem(bag, id, count) end received = doPlayerAddItemEx(cid, bag) if received == RETURNVALUE_NOERROR then doPlayerSendTextMessage(cid,19, "Voce recebeu >> "..productn.." << de seu Shop System.") db.query("UPDATE `shop_history` SET `processed`='1' WHERE id = " .. tid .. ";") else doPlayerSendTextMessage(cid,19, "Desculpe, voce não tem nenhum espaço na bp para receber >> "..productn.." <<") end else doPlayerSendTextMessage(cid,19, "Desculpe, voce não tem cap suficiente para receber >> "..productn.." << (Voce precisa de 5000 de cap.)") end end end itemr:free() if not(result:next()) then break end end result:free() end return true end Editado Março 10, 2019 6 anos por ITALOx (veja o histórico de edições) https://github.com/italoxxx1
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.