Postado Janeiro 15, 2015 10 anos Autor Mount = 631 Addon = 136 Exemplo Vou querer adquirir o Outfit Brotherhood Mas O ID Do Female é 279 E Do Male é 278 como faço ?
Postado Janeiro 15, 2015 10 anos Autor por isso tem que ser por storage.. ;] Ai vem a parte complicada rs... Esse script não é o responsável por entregar determinado item ao personagem quando efetua uma compra? pois o do servidor que estou usando é assim olha -- ### 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 O meu site já tem aquelas abas que separa os itens das montarias e dos addons, o site que estou usando é do liane. E no meu servidor isso também que entrega as montarias e os addons function onLogin(cid) if getPlayerStorageValue(cid, 80+555884621212) == 1 then doPlayerAddMount(cid, 6) doPlayerSendTextMessage(cid, 18, 'You received mount from ArenaTibia Shop.') setPlayerStorageValue(cid, 80+555884621212, 2) elseif getPlayerStorageValue(cid, 81+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received mount from ArenaTibia Shop.') doPlayerAddMount(cid, 20) setPlayerStorageValue(cid, 81+555884621212, 2) elseif getPlayerStorageValue(cid, 82+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received mount from ArenaTibia Shop.') doPlayerAddMount(cid, 29) setPlayerStorageValue(cid, 82+555884621212, 2) elseif getPlayerStorageValue(cid, 83+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received mount from ArenaTibia Shop.') doPlayerAddMount(cid, 30) setPlayerStorageValue(cid, 83+555884621212, 2) elseif getPlayerStorageValue(cid, 84+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received mount from ArenaTibia Shop.') doPlayerAddMount(cid, 27) setPlayerStorageValue(cid, 84+555884621212, 2) elseif getPlayerStorageValue(cid, 85+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received mount from ArenaTibia Shop.') doPlayerAddMount(cid, 21) setPlayerStorageValue(cid, 85+555884621212, 2) elseif getPlayerStorageValue(cid, 90+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received mount from ArenaTibia Shop.') doPlayerAddMount(cid, 24) setPlayerStorageValue(cid, 90+555884621212, 2) elseif getPlayerStorageValue(cid, 91+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received mount from ArenaTibia Shop.') doPlayerAddMount(cid, 33) setPlayerStorageValue(cid, 91+555884621212, 2) elseif getPlayerStorageValue(cid, 92+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received mount from ArenaTibia Shop.') doPlayerAddMount(cid, 41) setPlayerStorageValue(cid, 92+555884621212, 2) elseif getPlayerStorageValue(cid, 93+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received mount from ArenaTibia Shop.') doPlayerAddMount(cid, 23) setPlayerStorageValue(cid, 93+555884621212, 2) elseif getPlayerStorageValue(cid, 94+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received mount from ArenaTibia Shop.') doPlayerAddMount(cid, 9) setPlayerStorageValue(cid, 94+555884621212, 2) elseif getPlayerStorageValue(cid, 95+555884621212) == 2 then doPlayerSendTextMessage(cid, 18, 'You received mount from ArenaTibia Shop.') doPlayerAddMount(cid, 37) setPlayerStorageValue(cid, 95+555884621212, 2) elseif getPlayerStorageValue(cid, 96+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received mount from ArenaTibia Shop.') doPlayerAddMount(cid, 34) setPlayerStorageValue(cid, 96+555884621212, 2) elseif getPlayerStorageValue(cid, 97+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received mount from ArenaTibia Shop.') doPlayerAddMount(cid, 36) setPlayerStorageValue(cid, 97+555884621212, 2) elseif getPlayerStorageValue(cid, 98+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received mount from ArenaTibia Shop.') doPlayerAddMount(cid, 38) setPlayerStorageValue(cid, 98+555884621212, 2) elseif getPlayerStorageValue(cid, 116+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received mount from ArenaTibia Shop.') doPlayerAddMount(cid, 43) setPlayerStorageValue(cid, 116+555884621212, 2) elseif getPlayerStorageValue(cid, 117+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received mount from ArenaTibia Shop.') doPlayerAddMount(cid, 44) setPlayerStorageValue(cid, 117+555884621212, 2) elseif getPlayerStorageValue(cid, 118+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received mount from ArenaTibia Shop.') doPlayerAddMount(cid, 45) setPlayerStorageValue(cid, 118+555884621212, 2) elseif getPlayerStorageValue(cid, 119+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received mount from ArenaTibia Shop.') doPlayerAddMount(cid, 46) setPlayerStorageValue(cid, 119+555884621212, 2) elseif getPlayerStorageValue(cid, 120+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received mount from ArenaTibia Shop.') doPlayerAddMount(cid, 47) setPlayerStorageValue(cid, 120+555884621212, 2) elseif getPlayerStorageValue(cid, 121+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received mount from ArenaTibia Shop.') doPlayerAddMount(cid, 48) setPlayerStorageValue(cid, 121+555884621212, 2) elseif getPlayerStorageValue(cid, 122+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received mount from ArenaTibia Shop.') doPlayerAddMount(cid, 49) setPlayerStorageValue(cid, 122+555884621212, 2) elseif getPlayerStorageValue(cid, 123+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received mount from ArenaTibia Shop.') doPlayerAddMount(cid, 50) setPlayerStorageValue(cid, 123+555884621212, 2) elseif getPlayerStorageValue(cid, 124+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received mount from ArenaTibia Shop.') doPlayerAddMount(cid, 51) setPlayerStorageValue(cid, 124+555884621212, 2) elseif getPlayerStorageValue(cid, 125+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received mount from ArenaTibia Shop.') doPlayerAddMount(cid, 52) setPlayerStorageValue(cid, 125+555884621212, 2) -- Addons -- elseif getPlayerStorageValue(cid, 76+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received addon full from ArenaTibia Shop.') doPlayerAddOutfit(cid, 147, 3) doPlayerAddOutfit(cid, 143, 3) setPlayerStorageValue(cid, 76+555884621212, 2) elseif getPlayerStorageValue(cid, 77+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received addon full from ArenaTibia Shop.') doPlayerAddOutfit(cid, 142, 3) doPlayerAddOutfit(cid, 134, 3) setPlayerStorageValue(cid, 77+555884621212, 2) elseif getPlayerStorageValue(cid, 78+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received addon full from ArenaTibia Shop.') doPlayerAddOutfit(cid, 156, 3) doPlayerAddOutfit(cid, 152, 3) setPlayerStorageValue(cid, 78+555884621212, 2) elseif getPlayerStorageValue(cid, 79+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received addon full from ArenaTibia Shop.') doPlayerAddOutfit(cid, 466, 3) doPlayerAddOutfit(cid, 465, 3) setPlayerStorageValue(cid, 79+555884621212, 2) elseif getPlayerStorageValue(cid, 87+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received addon full from ArenaTibia Shop.') doPlayerAddOutfit(cid, 141, 3) doPlayerAddOutfit(cid, 133, 3) setPlayerStorageValue(cid, 87+555884621212, 2) elseif getPlayerStorageValue(cid, 88+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received addon full from ArenaTibia Shop.') doPlayerAddOutfit(cid, 471, 3) doPlayerAddOutfit(cid, 472, 3) setPlayerStorageValue(cid, 88+555884621212, 2) elseif getPlayerStorageValue(cid, 100+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received addon full from ArenaTibia Shop.') doPlayerAddOutfit(cid, 138, 3) doPlayerAddOutfit(cid, 130, 3) setPlayerStorageValue(cid, 100+555884621212, 2) elseif getPlayerStorageValue(cid, 126+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received addon full from ArenaTibia Shop.') doPlayerAddOutfit(cid, 618, 3) doPlayerAddOutfit(cid, 610, 3) setPlayerStorageValue(cid, 126+555884621212, 2) elseif getPlayerStorageValue(cid, 127+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received addon full from ArenaTibia Shop.') doPlayerAddOutfit(cid, 633, 3) doPlayerAddOutfit(cid, 632, 3) setPlayerStorageValue(cid, 127+555884621212, 2) elseif getPlayerStorageValue(cid, 128+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received addon full from ArenaTibia Shop.') doPlayerAddOutfit(cid, 635, 3) doPlayerAddOutfit(cid, 634, 3) setPlayerStorageValue(cid, 128+555884621212, 2) elseif getPlayerStorageValue(cid, 129+555884621212) == 1 then doPlayerSendTextMessage(cid, 18, 'You received addon full from ArenaTibia Shop.') doPlayerAddOutfit(cid, 637, 3) doPlayerAddOutfit(cid, 636, 3) setPlayerStorageValue(cid, 129+555884621212, 2) end return TRUE end Acho que na verdade já tem só precisa adicionar 1 por 1. com seu id neykos vocé poderia passa para nos em que pasta esta localizado este arquivo de storages e a tag dele ?
Postado Janeiro 16, 2015 10 anos Ai vem a parte complicada rs... neykos vocé poderia passa para nos em que pasta esta localizado este arquivo de storages e a tag dele ? o primeiro chama shop.lua e fica dentro da pasta "data\globalevents\scripts\others" Esse é o segundo script se o servidor for do mitsuig, fica dentro da pasta "data\creaturescripts\scripts\others" Chama addouns-montarias.lua Caso você conseguir pode me ajudar com o meu site também? Editado Janeiro 16, 2015 10 anos por neykos (veja o histórico de edições)
Postado Janeiro 16, 2015 10 anos Autor o primeiro chama shop.lua e fica dentro da pasta "data\globalevents\scripts\others" Esse é o segundo script se o servidor for do mitsuig, fica dentro da pasta "data\creaturescripts\scripts\others" Chama addouns-montarias.lua Caso você conseguir pode me ajudar com o meu site também? A parte do site amigo o da Liane da bugado mesmo por que fiz um teste com o shopsystem original adicionei uma mount só para testar sem os stages e foi normal adquirir ela normal só não vir no server ainda porque ele esta offline vou criar a aba de mounts e addons com base na aba de itens e posto pra você e pra todos do fórum ok abraços... testar o arquivinho de stages aqui cal quer novidade estarei avisando até mas
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.