Ir para conteúdo
  • Cadastre-se
  1. Hugoo222222

    Hugoo222222

  2. Bluetooth

    Bluetooth

  3. Mr. Crimson Prince

    Mr. Crimson Prince

  4. luanluciano93

    luanluciano93

  5. YuirtReta

    YuirtReta

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por luanluciano93
      Olá pessoal, estou desenvolvendo esse sistema vip para TFS 1.x, se precisarem de alguma função nova é só comentar, criei para usar em um servidor meu e resolvi postar, bom proveito a todos.
       
      É só ir no arquivo data/lib/core/player.lua e adicionar esse código no começo do script:
      -- ALTER TABLE `accounts` ADD `vip_time` BIGINT(20) NOT NULL DEFAULT 0; -- player:getVipTime() function Player.getVipTime(self) local resultId = db.storeQuery("SELECT `vip_time` FROM `accounts` WHERE `id` = '".. self:getAccountId() .."';") local time = resultId ~= false and result.getNumber(resultId, "vip_time") or 0 result.free(resultId) return time end -- player:isVip() function Player.isVip(self) return self:getVipTime() > os.time() and true or false end -- player:addVipDays(days) function Player.addVipDays(self, days) return(self:isVip() and tonumber((days * 86400))) and db.query("UPDATE `accounts` SET `vip_time` = '".. (self:getVipTime() + (days * 86400)) .."' WHERE `id` ='".. self:getAccountId() .."' LIMIT 1 ;") or db.query("UPDATE `accounts` SET `vip_time` = '".. (os.time() + (days * 86400)) .."' WHERE `id` ='".. self:getAccountId() .."' LIMIT 1 ;") end -- player:removeVipDays(days) function Player.removeVipDays(self, days) return(self:isVip() and tonumber((days * 86400))) and db.query("UPDATE `accounts` SET `vip_time` = '".. (self:getVipTime() - (days * 86400)) .."' WHERE `id` ='".. self:getAccountId() .."' LIMIT 1 ;") or db.query("UPDATE `accounts` SET `vip_time` = '".. (os.time() - (days * 86400)) .."' WHERE `id` ='".. self:getAccountId() .."' LIMIT 1 ;") end -- player:setVipDays(days) function Player.setVipDays(self, days) return db.query("UPDATE `accounts` SET `vip_time` = '".. (os.time() - (days * 86400)) .."' WHERE `id` ='".. self:getAccountId() .."' LIMIT 1 ;") end -- player:removeVip() function Player.removeVip(self) db.query("UPDATE `accounts` SET `vip_time` = '0' WHERE `id` ='".. self:getAccountId() .."' LIMIT 1 ;") end -- player:sendVipDaysMessage() function Player.sendVipDaysMessage(self) if self:isVip() then local vipTime = self:getVipTime() - os.time() local vipDays = 1 + (math.floor(vipTime / 86400)) return self:getVipTime() ~= false and self:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'You have '.. vipDays .. ' vip day(s) in your account.') end end -- player:checkVipLogin() function Player.checkVipLogin(self) if self:getVipTime() > 0 and not self:isVip() then return self:removeVip() and self:teleportTo(self:getTown():getTemplePosition()) end end  
       
      As funções são:
      • player:getVipTime() - Retorna o valor da tabela vip_time (igual esta na database).
      • player:isVip() - Retorna se o player é vip ou não.
      • player:addVipDays(days) - Usa-se em algum script para para adicionar dias de vip ao player (parâmetro de entrada "days").
      • player:removeVipDays(days) - Usa-se em algum script para para remover dias de vip do player (parâmetro de entrada "days").
      • player:setVipDays(days) - Usa-se em algum script para para mudar os dias de vip do player (parâmetro de entrada "days").
      • player:removeVip() - Usa-se em algum script para para remover todo tempo de vip do player.
      • player:sendVipDaysMessage() - Retorna uma mensagem no player mostrando os dias de vip que ainda restam ao player.
      • player:checkVipLogin() - Checa se a vip do player acabou, se sim teleporta ele para o templo.
       

      Qualquer dúvida ou erro/bug poste aqui.
    • Por DeCarvalho
      Bem procurei aqui na comunidade um VIP System mais informativo e nada, além de ter tido problema com os que estão aqui e acabei achando em outro lugar um que funcionou perfeitamente para mim.
       
      Usando tfs disponibilizado neste tópico http://www.tibiaking.com/forum/topic/53099-1078-tfs-12-cast-system-novos-outfits-mounts/
       
      Só estou trazendo o conteúdo e por não conhecer bem não posso dar suporte mas do jeito que está é só 'instalar' e vai funcionar.
       
      Creditos.: Summ
       
      Sistema Vip
       



       
      Talkaction !checkvip para todos os players
       



       
      Talkaction /vip para membros da staff
      - /vip adddays, NomedoPlayer, 5 --> Adiciona 5 dias vip para o Player. - /vip removedays, NomedoPlayer, 5 --> Remove 5 dias vip do Player. - /vip remove, PlayerName --> Remove todos os dias vip do Player. - /vip check, NomedoPlayer --> Checa quantos dias vip o Player tem. - /vip addinfinite, NomedoPlayer --> Adiciona tempo vip infinito para o Player.


       
      Tiles VIP



       
      Portas VIP / Actions



       
      Items que adicionam dias VIP
      ItemId 10135 adiciona 10 dias vip. ItemId 10134 adiciona 30 dias vip. ItemId 10133 adiciona 90 dias vip.


       
      Imagens
       
      Comando !checkvip mas sem ter vip



       
      Comando /vip adddays, dracoknight, 5



       
      Comando !checkvip após adicionar 5 dias



       
      Comando /vip addinfinite, dracoknight



       
      Comando !checkvip após usar infinite 



       
      Comando /vip remove, dracoknight



    • Por Loldinis
      TFS 1.0
      Pessoal, preciso de uma spell que gaste % de vida ao invés de mana

      Atualmente ela ta assim
      Quem souber da um help, vlw
    • Por Pedriinz
      Depois da atualização da TFS, esses scripts ficaram assim:
       
      [Warning - Event::checkScript] Can not load script: scripts/alladdons.lua
      data/talkactions/scripts/alladdons.lua:1: unexpected symbol near '�'
      [Warning - Event::checkScript] Can not load script: scripts/allmounts.lua
      data/talkactions/scripts/allmounts.lua:1: unexpected symbol near '�'
       
       
      Alguem poderia ajudar ?
       
      alladddons.lua
      function onSay(cid, words, param) local femaleOutfits = { ["citizen"]={136}, ["hunter"]={137}, ["knight"]={139}, ["noblewoman"]={140}, ["warrior"]={142}, ["barbarian"]={147}, ["druid"]={148}, ["wizard"]={149}, ["oriental"]={150}, ["pirate"]={155}, ["assassin"]={156}, ["beggar"]={157}, ["shaman"]={158}, ["norsewoman"]={252}, ["nightmare"]={269}, ["jester"]={270}, ["brotherhood"]={279}, ["demonhunter"]={288}, ["yalaharian"]={324}, ["warmaster"]={336},["wayfarer"]={366}, ["afflicted"]={431}, ["elementalist"]={433}, ["deepling"]={464}, ["insectoid"]={466}, ["red baron"]={471}, ["crystal warlord"]={513}, ["soil guardian"]={514}, ["demon"]={542} } local maleOutfits = { ["citizen"]={128}, ["hunter"]={129}, ["knight"]={131}, ["nobleman"]={132}, ["warrior"]={134}, ["barbarian"]={143}, ["druid"]={144}, ["wizard"]={145}, ["oriental"]={146}, ["pirate"]={151}, ["assassin"]={152}, ["beggar"]={153}, ["shaman"]={154}, ["norsewoman"]={251}, ["nightmare"]={268}, ["jester"]={273}, ["brotherhood"]={278}, ["demonhunter"]={289}, ["yalaharian"]={325}, ["warmaster"]={335}, ["wayfarer"]={367}, ["afflicted"]={430}, ["elementalist"]={432}, ["deepling"]={463}, ["insectoid"]={465}, ["red baron"]={472}, ["crystal warlord"]={512}, ["soil guardian"]={516},["demon"]={541} } local player, param = Player(cid), string.lower(param) local addondoll_id = 9693 if player:getItemCount(addondoll_id) > 0 then if param ~= "" and maleOutfits[param] and femaleOutfits[param] then local outfit = player:getSex() == 0 and femaleOutfits[param][1] or maleOutfits[param][1] if not player:hasOutfit(outfit, 3) then player:removeItem(addondoll_id, 1) player:sendTextMessage(MESSAGE_INFO_DESCR, "Seu Addon full foi adicionado!") Position(getThingPos(cid)):sendMagicEffect(CONST_ME_GIFT_WRAPS) player:addOutfitAddon(outfit, 3) else player:sendTextMessage(MESSAGE_INFO_DESCR, "Voce ja tem este addon") end else player:sendTextMessage(MESSAGE_INFO_DESCR, "Digite novamente, algo esta errado!") end else player:sendTextMessage(MESSAGE_INFO_DESCR, "Voce nao tem addon doll!") end end allmounts.lua
      function onSay(cid, words, param) local table = { -- ["mount"] = {price = x, id = x}, ["black sheep"] = {price = 0, id = 4}, ["crystal wolf"] = {price = 0, id = 16}, ["draptor"] = {price = 0, id = 6}, ["dromedary"] = {price = 0, id = 20}, ["gnarlhound"] = {price = 0, id = 32}, ["hellgrip"] = {price = 0, id = 39}, ["kingly deer"] = {price = 0, id = 18}, ["lady bug"] = {price = 0, id = 27}, ["manta ray"] = {price = 0, id = 28}, ["midnight panther"] = {price = 0, id = 5}, ["racing bird"] = {price = 0, id = 2}, ["rapid boar"] = {price = 0, id = 10}, ["scorpion king"] = {price = 0, id = 21}, ["panda"] = {price = 0, id = 19}, ["tiger slug"] = {price = 0, id = 14}, ["tin lizzard"] = {price = 0, id = 8}, ["titanica"] = {price = 0, id = 7}, ["uniwheel"] = {price = 0, id = 15}, ["widow queen"] = {price = 0, id = 1} } local player, param = Player(cid), string.lower(param) local mountdoll_id = 13030 -- id do addon doll local t = table[param] if player:getItemCount(mountdoll_id) > 0 then if param ~= "" and t then if not player:hasMount(t.id) then player:sendTextMessage(MESSAGE_INFO_DESCR, "Sua mount foi adicionada!") player:removeItem(mountdoll_id, 1) Position(getThingPos(cid)):sendMagicEffect(CONST_ME_GIFT_WRAPS) player:addMount(t.id) else player:sendTextMessage(MESSAGE_INFO_DESCR, "Voce ja tem esta mount.") end else player:sendTextMessage(MESSAGE_INFO_DESCR, "Digite novamente, algo está errado!") end else player:sendTextMessage(MESSAGE_INFO_DESCR, "Voce não tem um mount doll!") end end
    • Por massucoserver
      Estou com o seguinte problema:
      - Eu compro algum item no SHOP do Gesior e não recebo no meu char.
       
      Informações:
      Servidor: TFS 1.0 versão 10.37
      Site: Gesior 2015 1.0 do Victor Raful > LINK
       
      Encontrei uma possível solução em um tópico do TibiaKing:
      - Adicionar um script SHOP no GlobalEvents.
       
      Fiz, isso, e obtive o seguinte erro no Distro:

       
      O script que eu adicionei foi: (globalevents/scripts/shop.lua)
      -- ### CONFIG ### -- message send to player by script "type" (types you can check in "global.lua") SHOP_MSG_TYPE = 19 -- 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.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 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) 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.executeQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";") db.executeQuery("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 E no globalevents.xml :
      <globalevent name="shop" interval="30" script="shop.lua"/> ALGUÉM PODE ME AJUDAR?
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo