Postado Março 6, 2018 7 anos TFS 0.4 Bom eu peguei uma script de shop.lua aqui no forum, Instalei ela no meu server e funcionou perfeitamente. Ela adiciona uma descrição no item(attribute) Assim dando pra excluir os itens clonados, Porém preciso de um comando sql para achar todos itens vips que não tem esta descrição, Eu utilizo modern acc e Xampp! Agradeço ai! Você tem o código disponível? Se tiver publique-o aqui: 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 um_um = {1,2,3,4,5,6,7,8,9,0} um = um_um[math.random(1, #um_um)] local dois_dois = {1,2,3,4,5,6,7,8,9,0} dois = dois_dois[math.random(1, #dois_dois)] local tres_tres = {1,2,3,4,5,6,7,8,9,0} tres = tres_tres[math.random(1, #tres_tres)] local quatro_quatro = {1,2,3,4,5,6,7,8,9,0} quatro = quatro_quatro[math.random(1, #quatro_quatro)] 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 = doPlayerAddItem(cid, id, count, false) if received then doItemSetAttribute(received, "description", ''.. productn ..' Comprado por: ' .. getCreatureName(cid) .. ' [ID:' .. um .. '' .. dois .. '' .. tres .. '' .. quatro .. '].') doPlayerSendTextMessage(cid,19, "You have received >> "..productn.." << from our shop system") db.query("UPDATE `shop_history` SET `processed`='1' WHERE id = " .. tid .. ";") f = io.open("data/logs/Shop.txt", "a+") f:write("Player : '".. productn .." Comprado por: ".. getCreatureName(cid) .." [ID: ".. um .."".. dois .."".. tres .."".. quatro .."] Item : "..productn.." - "..getCreatureName(cid).."- " .. os.date("%d %B %Y - %X.", os.time()) .."\n----------------------------------------------------------\n") f:close() else doPlayerSendTextMessage(cid,19, "Desculpe, você não tem espaço suficiente em sua Backpack para receber a(o) >> "..productn.." <<") end else doPlayerSendTextMessage(cid,19, "Desculpe você não tem nenhuma Backpack para receber a(o) >> "..productn.." <<") end else doPlayerSendTextMessage(cid,19, "Desculpe, você não tem capacidade suficiente para receber a(o) >> "..productn.." << (Você precisa de: "..getItemWeightById(id, count).." de capacidade.)") 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, "Você recebeu >> "..productn.." << do nosso Shop. Bom uso dele!") db.query("UPDATE `shop_history` SET `processed`='1' WHERE id = " .. tid .. ";") else doPlayerSendTextMessage(cid,19, "Desculpe, você não tem espaço para receber a(o) >> "..productn.." <<") end else doPlayerSendTextMessage(cid,19, "Desculpe, você não tem capacidade para receber a(o) >> "..productn.." << (Você precisa de: "..getItemWeightById(id, count).." Capacidade.)") end end end itemr:free() if not(result:next()) then break end end result:free() end return true end Naruto Age of Darkness (Naruto World)
Postado Março 30, 2018 7 anos Este é para ver os itens que foram vendidos SELECT * , SUBSTRING( CONVERT( attributes USING latin1 ) FROM 18 ) AS 'serial' FROM player_items WHERE CONVERT( attributes USING latin1 ) LIKE '%serial%' Este é para ver os que foram clonados --Use this command to see duplicated items on players inventory SELECT * , SUBSTRING( CONVERT( attributes USING latin1 ) FROM 18 ) AS 'duplicated serials' FROM player_items WHERE SUBSTRING( CONVERT( attributes USING latin1 ) FROM 18 ) IN ( SELECT SUBSTRING( CONVERT( attributes USING latin1 ) FROM 18 ) FROM player_items WHERE CONVERT( attributes USING latin1 ) LIKE '%serial%' GROUP BY SUBSTRING( CONVERT( attributes USING latin1 ) FROM 18 ) HAVING COUNT( * ) >1 ) --Use this command to see duplicated items on players inventory or depot items SELECT * , SUBSTRING( CONVERT( attributes USING latin1 ) FROM 18 ) AS 'duplicated serials' FROM player_items WHERE SUBSTRING( CONVERT( attributes USING latin1 ) FROM 18 ) IN ( SELECT SUBSTRING( CONVERT( attributes USING latin1 ) FROM 18 ) FROM player_depotitems WHERE CONVERT( attributes USING latin1 ) LIKE '%serial%' GROUP BY SUBSTRING( CONVERT( attributes USING latin1 ) FROM 18 ) HAVING COUNT( * ) >1 ) --Use this command to see duplicated items on players depots SELECT * , SUBSTRING( CONVERT( attributes USING latin1 ) FROM 18 ) AS 'duplicated serials' FROM player_depotitems WHERE SUBSTRING( CONVERT( attributes USING latin1 ) FROM 18 ) IN ( SELECT SUBSTRING( CONVERT( attributes USING latin1 ) FROM 18 ) FROM player_depotitems WHERE CONVERT( attributes USING latin1 ) LIKE '%serial%' GROUP BY SUBSTRING( CONVERT( attributes USING latin1 ) FROM 18 ) HAVING COUNT( * ) >1 ) --Use this command to see duplicated items on player_items and player_depotitems (Example of usage) --Use this command to see duplicated items on players depots SELECT * , SUBSTRING( CONVERT( attributes USING latin1 ) FROM 18 ) AS 'duplicated serials' FROM player_items WHERE SUBSTRING( CONVERT( attributes USING latin1 ) FROM 18 ) IN ( SELECT SUBSTRING( CONVERT( attributes USING latin1 ) FROM 18 ) FROM player_depotitems WHERE CONVERT( attributes USING latin1 ) LIKE '%serial%' GROUP BY SUBSTRING( CONVERT( attributes USING latin1 ) FROM 18 ) HAVING COUNT( * ) >0 testa ai e me avisa Editado Março 30, 2018 7 anos por kukas9 (veja o histórico de edições)
Postado Março 30, 2018 7 anos Autor Nenhum deu certo, todos dizem : MySQL não retornou nenhum registo. (A consulta demorou 0,0000 segundos.) Porém, Tem sim, até comprei mais um item de lá pra testar! e tem varios em bag duplicados que eu criei mais não achou nenhum deles Naruto Age of Darkness (Naruto World)
Postado Março 30, 2018 7 anos Não use todos de uma vez, vou reforçar a separação da seção pois é um comando pra cada, ta escrito em ingles, tem alguns comandos a mais que eu acrescentei para mim mesmo, mas o topico que pode lhe ajudar é esse Editado Março 30, 2018 7 anos por kukas9 (veja o histórico de edições)
Postado Março 30, 2018 7 anos Autor Eu sei, mais esse é gesior, e também percebi que era varios comandos! Testei um por um mais deram esse erro em todos 6 horas atrás, kukas9 disse: Não use todos de uma vez, vou reforçar a separação da seção pois é um comando pra cada, ta escrito em ingles, tem alguns comandos a mais que eu acrescentei para mim mesmo, mas o topico que pode lhe ajudar é esse Testei esses comandos, mas aparece os comprados no shop queria que desse pra aparecer os itens que são vips mais que não foram comprados lá! ou todos sem o Comprado Por, pra excluir sem deletar eles os clonados Naruto Age of Darkness (Naruto World)
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.