Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Spoiler

5a1ee72ce50fc_shop.luaerro.thumb.png.f002368f091c6e4bb92052a196fae872.png

Quando coloco para comprar uma vocação, ou item, eu entro no personagem e aparece isso no meu open, não sou bom com tibia mas gostaria de aprender, e se pudesse me ajudar a resolver esse problema, pfv entrar em contato

 

obs:. não sei se estou postando no local certo o.O então pfv se puder mover o post agradicido

Link para o post
Compartilhar em outros sites

Este tópico foi movido para a área correta. Esta é uma mensagem automática!
Pedimos que leia as regras do fórum!

Spoiler

This topic has been moved to the correct area. This is an automated message!
Please read the forum rules.

 

4 horas atrás, papamundo disse:

então pfv se puder mover o post agradicido

É só ler a descrição das seções e saberá onde postar, postar em locais errado é contra as regras e como toda regra infringida tem sua punição, então tenha cuidado! 

 

@Tópico: É impossível lhe ajuda sem você postar o script, afinal não tem como ver onde está o erro "no script"! 

                                                              ezgif-1-98aab239f3.gif.1a897c9c3225228909e7b356a5cfb8e4.gif

Link para o post
Compartilhar em outros sites
5 minutos atrás, KotZletY disse:

Este tópico foi movido para a área correta. Esta é uma mensagem automática!
Pedimos que leia as regras do fórum!

  Mostrar conteúdo oculto

This topic has been moved to the correct area. This is an automated message!
Please read the forum rules.

 

É só ler a descrição das seções e saberá onde postar, postar em locais errado é contra as regras e como toda regra infringida tem sua punição, então tenha cuidado! 

 

@Tópico: É impossível lhe ajuda sem você postar o script, afinal não tem como ver onde está o erro "no script"! 

E se eu postar script do shop.lua que diz que ta dando o erro ?

 

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

ai estar o script shop.lua mencionado no erro

Link para o post
Compartilhar em outros sites

Tenta

 

local SHOP_MSG_TYPE = MESSAGE_EVENT_ORANGE
local SQL_interval = 30
 
function onThink(interval, lastExecution, thinkInterval)
        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

 

Editado por Gnius (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
11 minutos atrás, Gnius disse:

Tenta

local SHOP_MSG_TYPE = MESSAGE_EVENT_ORANGE
local SQL_interval = 30
 
        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

mano parou de dar o erro no log do serve, mais os itens continuam sem funcionar kk, tem contato para vc poder me ajudar se não estive ocupado claro

Link para o post
Compartilhar em outros sites

Desculpa,erro meu vê se vai

 

local SHOP_MSG_TYPE = MESSAGE_EVENT_ORANGE
local SQL_interval = 30
 
function onThink(interval, lastExecution, thinkInterval)
        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

Link para o post
Compartilhar em outros sites
6 minutos atrás, Gnius disse:

Desculpa,erro meu vê se vai

 

local SHOP_MSG_TYPE = MESSAGE_EVENT_ORANGE
local SQL_interval = 30
 
function onThink(interval, lastExecution, thinkInterval)
        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

 voltou o erro no log :/ 

Link para o post
Compartilhar em outros sites

Tenta essa script,é o mesmo sistema

 

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

Link para o post
Compartilhar em outros sites
8 minutos atrás, Gnius disse:

Tenta essa script,é o mesmo sistema

 

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

Spoiler

5a1f43853c5fd_Semttulo.thumb.png.5967bfc8324a99a642e1e74499921a7f.png

agora tá dando isso

Link para o post
Compartilhar em outros sites

Tenta

 

function onThink(interval, lastExecution, thinkInterval)
 
 
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")
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")
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

Link para o post
Compartilhar em outros sites
18 minutos atrás, Gnius disse:

Tenta essa script,é o mesmo sistema

 

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

Spoiler

5a1f45e58d21d_Semttulo.thumb.png.0e42499f007be8e46998fc9ebc794169.png

bom desde a 1 foto nessa notei que sumiu o numero 38 que foi mencionado no log, agora apareceu só o 4 sera q isso é bom kk ?

Link para o post
Compartilhar em outros sites

Amigao faz o seguinte

 

Vai no seu localhost/phpmyadmin

Após isso vai no seu banco de dados

Feito isso vai na parte de cima onde tá escrito SQL e coloca isso lá

INSERT INTO `shop_history`(`id`, `product`, `session`, `player`, `date`, `processed`) VALUES ([value-1],[value-2],[value-3],[value-4],[value-5],[value-6])

da ok

Depois coloca o script novamente

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

Creio que o SQL não vai ir

VocÊ vai ter q baixar esse shop.rar

Extrair dentro do htdocs do seu site

Depois disso vai no localhost/phpmyadmin

Vai na seu banco de dados

vai em importart

procura  em htdocs/shop/config/

importa o arquivo Shop.sql

E usa a script acima que mandei pra vocÊ

Crei oque não haverá mais erros

shop.rar

Link para o post
Compartilhar em outros sites
33 minutos atrás, Gnius disse:

 

 

59 minutos atrás, Gnius disse:

Amigao faz o seguinte

 

Vai no seu localhost/phpmyadmin

Após isso vai no seu banco de dados

Feito isso vai na parte de cima onde tá escrito SQL e coloca isso lá

INSERT INTO `shop_history`(`id`, `product`, `session`, `player`, `date`, `processed`) VALUES ([value-1],[value-2],[value-3],[value-4],[value-5],[value-6])

da ok

Depois coloca o script novamente

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

Creio que o SQL não vai ir

VocÊ vai ter q baixar esse shop.rar

Extrair dentro do htdocs do seu site

Depois disso vai no localhost/phpmyadmin

Vai na seu banco de dados

vai em importart

procura  em htdocs/shop/config/

importa o arquivo Shop.sql

E usa a script acima que mandei pra vocÊ

Crei oque não haverá mais erros

shop.rar

 

1 hora atrás, Gnius disse:

Amigao faz o seguinte

 

Vai no seu localhost/phpmyadmin

Após isso vai no seu banco de dados

Feito isso vai na parte de cima onde tá escrito SQL e coloca isso lá

INSERT INTO `shop_history`(`id`, `product`, `session`, `player`, `date`, `processed`) VALUES ([value-1],[value-2],[value-3],[value-4],[value-5],[value-6])

da ok

Depois coloca o script novamente

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

Creio que o SQL não vai ir

VocÊ vai ter q baixar esse shop.rar

Extrair dentro do htdocs do seu site

Depois disso vai no localhost/phpmyadmin

Vai na seu banco de dados

vai em importart

procura  em htdocs/shop/config/

importa o arquivo Shop.sql

E usa a script acima que mandei pra vocÊ

Crei oque não haverá mais erros

shop.rar

o erro no log parou mais, ainda não consigo comprar itens na loja do site, não aparece no personagem nem as vocações, mas  n da erro mais no log

Link para o post
Compartilhar em outros sites
1 minuto atrás, papamundo disse:

 

 

o erro no log parou mais, ainda não consigo comprar itens na loja do site, não aparece no personagem nem as vocações, mas  n da erro mais no log

Ja adicionou os items do shop no seu site?

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.


  • Conteúdo Similar

    • Por ILex WilL
      Olá, Alguém poderia me ajudar com uns Scripts? nem que seja cobrando, dependendo eu pago para me ajudar...
    • Por zLockey9
      Estou com alguns erros em umas SPR que adicionei recentemente , como o titulo já diz ...
      elas estão saindo do lado do char em vez de em cima. (Obs:Não é spell e sim só o effect do comando /z)
       
      Se alguém puder ajudar dou REP+
       
      ALGUMAS PRINT'S
       
       
    • Por Digoshow
      Quando eu coloco 100 crystal coin no shop aperto em Buy, para fazer o teste e vem a seguinte mensagem falando que o id não existe, como assim não existe?
      Vou postar uma imagem da mensagem.
       

       
       
      Como eu arrumo isso, quero coloca 100 crystal coin la no shop, so que o id não existe porque o id esta certo 2160, como arrumo?
       
      Obrigado, REP +
    • Por llucas75
      Oi tudo bem pessoal?
       
      Meu problema é o seguinte eu tenho um otserver 8.60, mas quero rodá-lo em linux ai precisando compilar... Compilei um Rev3777(0.4), mas quando ligo o servidor aparecem uma imensidão de erros no console, além de mau funcionamento do server...
      Tentei pegar as libs da pasta data do rev3777 e colocalos no lugar das libs do meu server... Mas dai o server nem abre...
       
       
      Queria muito executar esse server em linux, por causa da proteção adicional que ele oferece, alguem sabe como eu faço para ele rodar de maneira adequada com o meu executavel da rev3777?
    • Por firebolt
      galera ta acontecendo o seguinte, eu tava com um problema que o shop do site não entregava items no jogo, dai consegui resoler o problema com o pessoal aqui do forum, só que ai quando eu terminei de arrumar os items e tava quase pronto pra por o ot on, eu vi que não tava mais dando pra addicionar items no shop do site, dai eu percebi que deu esse problema quando eu arrumei a parte que o shoping manda items no jogo, por favor to precisando disso urgente pois só falta isso para mim abrir meu servidor.. obrigado
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo