Postado Dezembro 7, 2015 9 anos Em 07/12/2015 em 21:42, paulorogerio disse: Muito obrigado, salvou a pátria .. agora vou tentar tirar os bugs que eu estava tirando antes de dar problema se tiver algo sobre bug de entregar a grana e itens que vou colocar no site fico grato .. REP+ Se você se refere à entrega de itens do Shop do site do Gesior, na pasta globalevents/scripts crie um arquivo(se não existir já) chamado shop.lua e coloque o seguinte dentro dele: Mostrar conteúdo oculto SHOP_MSG_TYPE = 19 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 id = tonumber(result_plr:getDataInt("id")) action = tostring(result_plr:getDataString("action")) delete = tonumber(result_plr:getDataInt("delete_it")) cid = getCreatureByName(tostring(result_plr:getDataString("name"))) if isPlayer(cid) == TRUE 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 full_weight = getItemWeightById(itemtogive_id, 1) 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 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 .. ";") doPlayerSave(cid) else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> The item '.. add_item_name ..' << that you just bought on the website couldnt be added. Han error has ocurred, please wait '.. SQL_interval ..' seconds.. Shop ID: '.. id ..'') end else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> The item '.. add_item_name ..' << that you just bought on the website couldnt be added. Han error has ocurred, please wait '.. SQL_interval ..' seconds.. Shop ID: '.. id ..'') end end if not(result_plr:next()) then break end end result_plr:free() end return TRUE end Ai no globalevents.xml adicione a tag: Citar <globalevents name="shop" interval="4000" script="shop.lua"/> Isso se você usa o TFS 0.4, se não for TFS 0.4, no lugar de "4000" coloque apenas "4" Obs.: O script está editado para funcionar com TFS 0.4, se não estiver usando o TFS 0.4, troque todos os Citar db.query por Citar db.executeQuery TODOS! GitHub: https://github.com/s3kk Conteúdo: [SERVER] Heromassa[GESIOR] Gesior 2012 modificado por Sekk[GESIOR] Shop Addons & Mounts - TFS 1.x[GESIOR] Outfitter para Characters e Rank[SISTEMA] Castle 24h[TALKACTION] Multi Element Wand[ACTION] Multi Elemental Arrow & Shield[PROGRAMAÇÃO] Compilar TFS 0.4 no Linux[PROGRAMAÇÃO] Compilando TFS 0.4 no MSVC(x64 e x32) [INFRAESTRUTURA] Configuração COMPLETA Google VM + Tibia 11.x
Postado Dezembro 7, 2015 9 anos Autor Em 07/12/2015 em 21:50, Sekk disse: Se você se refere à entrega de itens do Shop do site do Gesior, na pasta globalevents/scripts crie um arquivo(se não existir já) chamado shop.lua e coloque o seguinte dentro dele: Mostrar conteúdo oculto Mostrar conteúdo oculto SHOP_MSG_TYPE = 19 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 id = tonumber(result_plr:getDataInt("id")) action = tostring(result_plr:getDataString("action")) delete = tonumber(result_plr:getDataInt("delete_it")) cid = getCreatureByName(tostring(result_plr:getDataString("name"))) if isPlayer(cid) == TRUE 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 full_weight = getItemWeightById(itemtogive_id, 1) 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 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 .. ";") doPlayerSave(cid) else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> The item '.. add_item_name ..' << that you just bought on the website couldnt be added. Han error has ocurred, please wait '.. SQL_interval ..' seconds.. Shop ID: '.. id ..'') end else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> The item '.. add_item_name ..' << that you just bought on the website couldnt be added. Han error has ocurred, please wait '.. SQL_interval ..' seconds.. Shop ID: '.. id ..'') end end if not(result_plr:next()) then break end end result_plr:free() end return TRUE end Ai no globalevents.xml adicione a tag: Isso se você usa o TFS 0.4, se não for TFS 0.4, no lugar de "4000" coloque apenas "4" Obs.: O script está editado para funcionar com TFS 0.4, se não estiver usando o TFS 0.4, troque todos os por TODOS! Eu tenho só xampp ,geisor e o ot to aprendendo ainda fico muito grato por sua ajuda .. Esse é o que estava no globalevents.xml <?xml version="1.0" encoding="UTF-8"?> <globalevents> <!-- <globalevent name="record" type="record" event="script" value="record.lua"/> --> <globalevent name="save" interval="500" event="script" value="save.lua"/> <globalevent name="clean" interval="7200000" event="script" value="clean.lua"/> <!-- <globalevent name="timer_example" time="21:35:11" event="script" value="my_script.lua"/> --> <globalevent name="information" interval="900000" event="script" value="autobroadcast.lua"/> <globalevent name="napis" interval="1" script="napis.lua"/> </globalevents>
Postado Dezembro 7, 2015 9 anos Em 07/12/2015 em 22:01, paulorogerio disse: Eu tenho só xampp ,geisor e o ot to aprendendo ainda fico muito grato por sua ajuda .. Esse é o que estava no globalevents.xml <?xml version="1.0" encoding="UTF-8"?> <globalevents> <!-- <globalevent name="record" type="record" event="script" value="record.lua"/> --> <globalevent name="save" interval="500" event="script" value="save.lua"/> <globalevent name="clean" interval="7200000" event="script" value="clean.lua"/> <!-- <globalevent name="timer_example" time="21:35:11" event="script" value="my_script.lua"/> --> <globalevent name="information" interval="900000" event="script" value="autobroadcast.lua"/> <globalevent name="napis" interval="1" script="napis.lua"/> </globalevents> Bah, nem precisava me mandar isso kkkkkk, o negocio de entregar itens pros players, é o shop do gesior, ai precisa desse script shop.lua pro site entregar os itens pro player entendeu? Qualquer coisa, pode me chamar! GitHub: https://github.com/s3kk Conteúdo: [SERVER] Heromassa[GESIOR] Gesior 2012 modificado por Sekk[GESIOR] Shop Addons & Mounts - TFS 1.x[GESIOR] Outfitter para Characters e Rank[SISTEMA] Castle 24h[TALKACTION] Multi Element Wand[ACTION] Multi Elemental Arrow & Shield[PROGRAMAÇÃO] Compilar TFS 0.4 no Linux[PROGRAMAÇÃO] Compilando TFS 0.4 no MSVC(x64 e x32) [INFRAESTRUTURA] Configuração COMPLETA Google VM + Tibia 11.x
Postado Dezembro 7, 2015 9 anos Autor Go Your account 0 7 December 2015, 21:14:31 Not realized yet. Teste um test a p.a da certo mas o item não da não dei como entrar como god nesse ot o site ainda ta bugado cloquei o script que vc mandou fiz um bloco de notas e colei la shop.lua
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.