Postado Maio 21, 2018 7 anos Galera eu estou com um erro no meu shop.lua, ele fica entregando itens sem parar ja procurei pela internet enteira e não achei a solução alguem pode me ajudar? http://prntscr.com/jkfxrt SHOP.LUA Spoiler function onThink(interval, lastExecution, thinkInterval)local result = db.getResult("SELECT * FROM shop_history WHERE processed = 0;")if(result:getID() ~= -1) thenwhile(true) docid = getCreatureByName(tostring(result:getDataString("player")))product = tonumber(result:getDataInt("product"))itemr = db.getResult("SELECT * FROM shop_offer WHERE id = "..product..";")if isPlayer(cid) thenlocal 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) thenif getPlayerFreeCap(cid) >= getItemWeightById(id, count) thenif isContainer(getPlayerSlotItem(cid, 3).uid) thenreceived = doAddContainerItem(getPlayerSlotItem(cid, 3).uid, id,count)if received thendoPlayerSendTextMessage(cid,19, "You have received >> "..productn.." << from our shop system")db.executeQuery("UPDATE shop_history SET `processed`='1' WHERE id = " .. tid .. ";")elsedoPlayerSendTextMessage(cid,19, "Sorry, you don't have enough space on container to receive >> "..productn.." <<")endelsedoPlayerSendTextMessage(cid,19, "Sorry, you don't have a container to receive >> "..productn.." <<")endelsedoPlayerSendTextMessage(cid,19, "Sorry, you don't have enough capacity to receive >> "..productn.." << (You need: "..getItemWeightById(id, count).." Capacity)")endelseif isInArray({6,7},tipe) thenif tipe == 6 thenbcap = 8bid = 1987elseif tipe == 7 thenbcap = 20bid = 1988endif isItemRune(id) thencount = 1endif getPlayerFreeCap(cid) >= (getItemWeightById(1987, 1) + getItemWeightById(id,count * bcap)) thenlocal bag = doCreateItemEx(bid, 1)for i = 1,bcap dodoAddContainerItem(bag, id, count)endreceived = doPlayerAddItemEx(getPlayerSlotItem(cid, 3).uid, bag)if received == RETURNVALUE_NOERROR thendoPlayerSendTextMessage(cid,19, "You have received >> "..productn.." << from our shop system")db.executeQuery("UPDATE shop_history SET `processed`='1' WHERE id = " .. tid .. ";")elsedoPlayerSendTextMessage(cid,19, "Sorry, you don't have enough space to receive >> "..productn.." <<")endelsedoPlayerSendTextMessage(cid,19, "Sorry, you don't have enough capacity to receive >> "..productn.." << (You need: "..getItemWeightById(id, count).." Capacity)")endendenditemr:free()if not(result:next()) thenbreakendendresult:free()endreturn trueend Meu Servidor:http://ntoimperio.ddns.net/
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.