Postado Fevereiro 6, 2015 10 anos #Detalhe sou o SUMM. Substitui esse seu shop.lua completamente por esse aqui : -- ### CONFIG ### -- message send to player by script "type" (types you can check in "global.lua") SHOP_MSG_TYPE = 18 -- time (in seconds) between connections to SQL database by shop script SQL_interval = 30 -- ### END OF CONFIG ### function onThink(interval, lastExecution) local result_plr = db.storeQuery("SELECT * FROM z_ots_comunication") if(result_plr ~= false) then repeat local id = tonumber(result.getDataInt(result_plr, "id")) local action = tostring(result.getDataString(result_plr, "action")) local delete = tonumber(result.getDataInt(result_plr, "delete_it")) local cid = getPlayerByName(tostring(result.getDataString(result_plr, "name"))) if(cid) then local itemtogive_id = tonumber(result.getDataInt(result_plr, "param1")) local itemtogive_count = tonumber(result.getDataInt(result_plr, "param2")) local container_id = tonumber(result.getDataInt(result_plr, "param3")) local container_count = tonumber(result.getDataInt(result_plr, "param4")) local add_item_type = tostring(result.getDataString(result_plr, "param5")) local add_item_name = tostring(result.getDataString(result_plr, "param6")) local storage = tostring(result.getDataString(result_plr, "param7")) local received_item = 0 local full_weight = 0 if(add_item_type == 'container') then container_weight = getItemWeight(container_id, 1) if(isItemRune(itemtogive_id)) then items_weight = container_count * getItemWeight(itemtogive_id, 1) else items_weight = container_count * getItemWeight(itemtogive_id, itemtogive_count) end full_weight = items_weight + container_weight else full_weight = getItemWeight(itemtogive_id, itemtogive_count) if(isItemRune(itemtogive_id)) then full_weight = getItemWeight(itemtogive_id, 1) else full_weight = getItemWeight(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) received_item = doPlayerAddItemEx(cid, new_item) end if(type(received_item) == "number" and received_item == RETURNVALUE_NOERROR) then doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received '.. add_item_name ..' from ArenaTibia Shop.') setPlayerStorageValue(cid,storage+555884621212,1) 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 ArenaTibia 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 ..' ArenaTibia 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 until not result.next(result_plr) result.free(result_plr) end return true end Editado Fevereiro 6, 2015 10 anos por fywell (veja o histórico de edições)
Postado Fevereiro 7, 2015 10 anos #Detalhe sou o SUMM. Substitui esse seu shop.lua completamente por esse aqui : -- ### CONFIG ### -- message send to player by script "type" (types you can check in "global.lua") SHOP_MSG_TYPE = 18 -- time (in seconds) between connections to SQL database by shop script SQL_interval = 30 -- ### END OF CONFIG ### function onThink(interval, lastExecution) local result_plr = db.storeQuery("SELECT * FROM z_ots_comunication") if(result_plr ~= false) then repeat local id = tonumber(result.getDataInt(result_plr, "id")) local action = tostring(result.getDataString(result_plr, "action")) local delete = tonumber(result.getDataInt(result_plr, "delete_it")) local cid = getPlayerByName(tostring(result.getDataString(result_plr, "name"))) if(cid) then local itemtogive_id = tonumber(result.getDataInt(result_plr, "param1")) local itemtogive_count = tonumber(result.getDataInt(result_plr, "param2")) local container_id = tonumber(result.getDataInt(result_plr, "param3")) local container_count = tonumber(result.getDataInt(result_plr, "param4")) local add_item_type = tostring(result.getDataString(result_plr, "param5")) local add_item_name = tostring(result.getDataString(result_plr, "param6")) local storage = tostring(result.getDataString(result_plr, "param7")) local received_item = 0 local full_weight = 0 if(add_item_type == 'container') then container_weight = getItemWeight(container_id, 1) if(isItemRune(itemtogive_id)) then items_weight = container_count * getItemWeight(itemtogive_id, 1) else items_weight = container_count * getItemWeight(itemtogive_id, itemtogive_count) end full_weight = items_weight + container_weight else full_weight = getItemWeight(itemtogive_id, itemtogive_count) if(isItemRune(itemtogive_id)) then full_weight = getItemWeight(itemtogive_id, 1) else full_weight = getItemWeight(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) received_item = doPlayerAddItemEx(cid, new_item) end if(type(received_item) == "number" and received_item == RETURNVALUE_NOERROR) then doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received '.. add_item_name ..' from ArenaTibia Shop.') setPlayerStorageValue(cid,storage+555884621212,1) 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 ArenaTibia 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 ..' ArenaTibia 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 until not result.next(result_plr) result.free(result_plr) end return true end Esse é o mesmo que veio no servidor do mitsuig, que é o do meu servidor. O problema é que quando adiciono o addon ou mount no site e compro ele fica dando aquela mensagem que o char não tem capacidade ou slot na backpack. Eu coloco o número da storage certinho no shop vamos supor quero adicionar o addon no item id eu coloco 28416 e na quantidade de itens é 1 correto? mesmo se eu colocar para entregar o addon ou mount pela <event type="login" name="ShopMountAddon" script="addonmount.lua"/> e ao tentar entregar o item aparece o seguinte erro na distro referente ao shop.lua Lua Script Error: [GlobalEvent Interface] data/globalevents/scripts/others/shop.lua:onThink luaDoCreateItemEx(). Item not found stack traceback: [C]: in function 'doCreateItemEx' data/globalevents/scripts/others/shop.lua:87: in function <data/globalevents/scripts/others/shop.lua:7> Lua Script Error: [GlobalEvent Interface] data/globalevents/scripts/others/shop.lua:onThink luaPlayerAddItemEx(). Item not found stack traceback: [C]: in function 'addItemEx' data/compat.lua:279: in function 'doPlayerAddItemEx' data/globalevents/scripts/others/shop.lua:88: in function <data/globalevents/scripts/others/shop.lua:7> Editado Fevereiro 7, 2015 10 anos por neykos (veja o histórico de edições)
Postado Fevereiro 7, 2015 10 anos Você está esquecendo de mudar o offer_type pra 'mount' ou 'addon' ... Adicione a mount ou addon por comando via mysql no phpmyadmin : INSERT INTO `z_shop_offer` (`points`, `itemid1`, `count1`, `offer_type`, `offer_description`, `offer_name`) VALUES (10 , 87654, 1, 'mount', 'teste', 'Mount teste') points = pontos que vai custar; itemid1 = storage do addon/mount; count1 = 1 <-- deixe 1 offer_type = mount/addon <-- de acordo com que tu quer; offer_description = descrição do addon/mount; offer_name = nome da mount/addon; Lembre-se de usar o shop.lua acima que eu postei...
Postado Fevereiro 8, 2015 10 anos Você está esquecendo de mudar o offer_type pra 'mount' ou 'addon' ... Adicione a mount ou addon por comando via mysql no phpmyadmin : INSERT INTO `z_shop_offer` (`points`, `itemid1`, `count1`, `offer_type`, `offer_description`, `offer_name`) VALUES (10 , 87654, 1, 'mount', 'teste', 'Mount teste') points = pontos que vai custar; itemid1 = storage do addon/mount; count1 = 1 <-- deixe 1 offer_type = mount/addon <-- de acordo com que tu quer; offer_description = descrição do addon/mount; offer_name = nome da mount/addon; Lembre-se de usar o shop.lua acima que eu postei... Summ nao esqueci de mudar, para mount ou addon o offer type, simplesmente o shopsystem.php que postou, quando eu altero de item pra addons ou mounts no offer type, ele não aparece aquela aba do shopping lá em cima de addons e mount, fica apenas aquela aba dos itens... e as mount ou addon que adicionei não aparecem, por conta do shopsystem.php não estar criando a aba das mount e nem dos addons, por isso to colocando como offer type como item. Achei o problema mais não sei concerta, quando vou colocar tipo do item, aparece items, mounts, e addons por conta desse "s" no final não esta aparecendo na aba do shop as mounts e nem os addons. mais vou tentar concertar achar o stogare no shopsystem que está mount apenas e trocar por mounts Editado Fevereiro 8, 2015 10 anos por neykos (veja o histórico de edições)
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.