Ir para conteúdo

Patrick Jean

Membro
  • Registro em

  • Última visita

Tudo que Patrick Jean postou

  1. tenta esse script -- ### CONFIG ### -- message send to player by script "type" (types you can check in "global.lua") SHOP_MSG_TYPE = 17 -- time (in seconds) between connections to SQL database by shop script SQL_interval = 30 -- ### END OF CONFIG ### SQL_COMUNICATION_INTERVAL = SQL_interval * 1000 function onLogin(cid) if(InitShopComunication == 0) then local eventServ = addEvent(sql_communication, SQL_COMUNICATION_INTERVAL, {}) InitShopComunication = eventServ end registerCreatureEvent(cid, "PlayerDeath") return TRUE end function sql_communication(parameters) 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 = getPlayerByName(tostring(result_plr:getDataString("name"))) if isPlayer(cid) == TRUE then if action == 'give_item' 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 b_head_slot = getPlayerSlotItem(cid, 1) local b_necklace_slot = getPlayerSlotItem(cid, 2) local b_backpack_slot = getPlayerSlotItem(cid, 3) local b_armor_slot = getPlayerSlotItem(cid, 4) local b_right_hand = getPlayerSlotItem(cid, 5) local b_left_hand = getPlayerSlotItem(cid, 6) local b_legs_slot = getPlayerSlotItem(cid, 7) local b_feet_slot = getPlayerSlotItem(cid, 8) local b_ring_slot = getPlayerSlotItem(cid, 9) local b_arrow_slot = getPlayerSlotItem(cid, 10) if b_arrow_slot.itemid == 0 or (b_left_hand.itemid == 0 and b_right_hand.itemid == 0) then local full_weight = 0 if add_item_type == 'container' then container_weight = getItemWeight(container_id, 1) items_weight = container_count * getItemWeight(itemtogive_id, itemtogive_count) full_weight = items_weight + container_weight else full_weight = getItemWeight(itemtogive_id, itemtogive_count) end local free_cap = getPlayerFreeCap(cid) if full_weight <= free_cap then if add_item_type == 'container' then local new_container = doCreateItemEx(container_id) local iter = 0 while iter ~= container_count do doAddContainerItem(new_container, itemtogive_id, itemtogive_count) iter = iter + 1 end doPlayerAddItemEx(cid, new_container) itemtogive_id = container_id else local addeditem = doPlayerAddItem(cid, itemtogive_id, itemtogive_count) end local head_slot = getPlayerSlotItem(cid, 1) local necklace_slot = getPlayerSlotItem(cid, 2) local backpack_slot = getPlayerSlotItem(cid, 3) local armor_slot = getPlayerSlotItem(cid, 4) local right_hand = getPlayerSlotItem(cid, 5) local left_hand = getPlayerSlotItem(cid, 6) local legs_slot = getPlayerSlotItem(cid, 7) local feet_slot = getPlayerSlotItem(cid, 8) local ring_slot = getPlayerSlotItem(cid, 9) local arrow_slot = getPlayerSlotItem(cid, 10) if ring_slot.itemid == itemtogive_id or feet_slot.itemid == itemtogive_id or legs_slot.itemid == itemtogive_id or armor_slot.itemid == itemtogive_id or necklace_slot.itemid == itemtogive_id or head_slot.itemid == itemtogive_id or arrow_slot.itemid == itemtogive_id or left_hand.itemid == itemtogive_id or right_hand.itemid == itemtogive_id or backpack_slot.itemid == itemtogive_id then if b_ring_slot.uid ~= ring_slot.uid or b_feet_slot.uid ~= feet_slot.uid or b_legs_slot.uid ~= legs_slot.uid or b_armor_slot.uid ~= armor_slot.uid or b_necklace_slot.uid ~= necklace_slot.uid or b_head_slot.uid ~= head_slot.uid or b_backpack_slot.uid ~= backpack_slot.uid or b_right_hand.uid ~= right_hand.uid or b_left_hand.uid ~= left_hand.uid or b_arrow_slot.uid ~= arrow_slot.uid then doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from OTS shop. You should re-login now to become sure your new item will not disappear if any error occur.') 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 not added. Unknown error occured. Wait about '.. SQL_interval ..' seconds. If error will occur again contact with admin. Error item ID is: '.. id ..'') end else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop not added. Unknown error occured. Wait about '.. SQL_interval ..' seconds. If error will occur again contact with admin. Error item ID is: '.. id ..'') 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 or give to friend 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. Please take items from both hands or item from arrow slot and wait about '.. SQL_interval ..' seconds to get it.') end end end if not(result_plr:next()) then break end end result_plr:free() end local eventServ = addEvent(sql_communication, SQL_COMUNICATION_INTERVAL, parameters) end @EDIT copie todo o código acima e rode esse script na sua DB: CREATE TABLE IF NOT EXISTS `z_ots_comunication` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `type` varchar(255) NOT NULL, `action` varchar(255) NOT NULL, `param1` varchar(255) NOT NULL, `param2` varchar(255) NOT NULL, `param3` varchar(255) NOT NULL, `param4` varchar(255) NOT NULL, `param5` varchar(255) NOT NULL, `param6` varchar(255) NOT NULL, `param7` varchar(255) NOT NULL, `delete_it` int(2) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
  2. Cara, massa o script... Parabéns Quem sabe eu use nuns projetos futuros ai.. kk
  3. manda todo o script "shop.lua"...
  4. MichaelDoido, passe um contato para mim falar com você.. Você tem quanto tempo de disponibilidade para fazer..? Obrigado por contatar-nos.
  5. Precisamos URGENTE de Mappers.. Por favor, caso haja interesse, contate-nos! Obrigado.
  6. a tag não tem referencia ao Script..
  7. Ainda precisamos de pessoal para nossa equipe! Leiam mais em http://www.tibiaking.com/forum/topic/51950-vagas-b%C3%A9ria-alternative-server/ Obrigado.
  8. Cara, o Config.lua tem que estar na hospedagem... ou seja, vc não conseguira (sem problemas maiores) hospedar o site sem o seu servidor no host também...
  9. Patrick Jean postou uma resposta no tópico em Scripts tfs 0.4 (OLD)
    Pronto... TK e seus Bugs
  10. Patrick Jean postou uma resposta no tópico em Scripts tfs 0.4 (OLD)
    Coloquei... kk
  11. Patrick Jean postou uma resposta no tópico em Ouvidoria
    NADA legal! =/
  12. Patrick Jean postou uma resposta no tópico em Ouvidoria
    e o Pior que eu usei o Editor completo, e ele ja veio assim tlg?
  13. Patrick Jean postou uma resposta no tópico em Ouvidoria
    @Augusto Cara, o meu post tava perfeito, eu coloquei um "A", e salvei... deu nessa mer.. ai! e não é o primeiro post q eu vi com isso @olokomeu eu sempre uso o Editor completo, mas quando fui editar hj, ele apareceu isso ae :v
  14. Patrick Jean postou uma resposta no tópico em Ouvidoria
    ativado e desativado, não muda nada..
  15. Patrick Jean postou uma resposta no tópico em Ouvidoria
    Eu não mudei nada no meu código, só adicionei uns campos, e virou nisso.. Alguem pode resolver?
  16. não é ai que abre... tenta achar algo como "Virtual Server" ou algo assim...
  17. Alguém sabe dizer quais são as "Groups" do RadBR?? Obrigado!
  18. Estou totalmente aberto para sugestões, criticas/dicas construtivas sobre o Mapa e o Servidor. As imagens podem ser modificadas/excluidas, conforme necessário. Aguardem mais novidades sobre... Agradeço á todos. Clique aqui e acesse o Projeto Béria Alternative Server Clique aqui e acesse as Vagas disponiveis no Béria Alternative Server
  19. Double Tópic amigo?? Reportado! http://www.tibiaking.com/forum/topic/52135-pedido-servidor-otpokemon-v-10/ http://www.tibiaking.com/forum/topic/52136-pedido-servidor-otpokemon-v-10
  20. Patrick Jean postou uma resposta no tópico em Suporte Tibia OTServer
    baiak.tile_store e baiak.player_inboxitems não existem... vc colocou algum sistema a mais no seu servidor que precisa de banco de dados?
  21. Patrick Jean postou uma resposta no tópico em Scripts tfs 0.4 (OLD)
    Olá pessoal maroto do TK... Estou disponibilizando um Script que eu tinha no meu HD externo, ele seria uma runa de teletransporte... ~Compatibilidade~ Feito e testado em TFS 1.1 ~Funcionamento~ A runa funciona da seguinte forma: O player clica na runa e seleciona o local onde ele quer ser teleportado. Se o local desejado der pra ir andando, ele será teleportado, se não, ele não irá. ~Colocando a mão na massa~ ~Observações~ Não se esqueça de mudar o ID da runa na tag para uma que não está sendo utilizada no seu servidor. Essa runa se comportará como qualquer outra. ~Créditos~ Não lembro dos creditos, mas dou todo o crédito ao Criador do Script e a mim por ter postado.

Informação Importante

Confirmação de Termo