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

    Skydangerous

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por Skydangerous
      O script é bem simples, ele salva a sua posição no mapa para que você possa retornar no lugar quando quiser.



      Salvando a posição(waypoint) no mapa






      Voltando novamente na posição






      Se tentar novamente não irá conseguir




      Crie um arquivo chamado funtele.lua na pasta talkaction/scripts

      function doMarkPos(cid, posx, posy, posz) setPlayerStorageValue(cid, 19000, posx) setPlayerStorageValue(cid, 19001, posy) setPlayerStorageValue(cid, 19002, posz) end function getMarkPos(cid) return {x=getPlayerStorageValue(cid, 19000), y=getPlayerStorageValue(cid, 19001), z=getPlayerStorageValue(cid, 19002)} end function onSay(cid, words, param) local pos = getCreaturePosition(cid) if words == "!salvar" then if getMarkPos(cid).x < 1 then doSendMagicEffect(pos,15) doMarkPos(cid, pos.x, pos.y, pos.z) doPlayerSendTextMessage(cid, 4, "Você salvou posicao no mapa.") else doPlayerSendCancel(cid, "Você já gravou posição.") end elseif words == "!voltar" then if getMarkPos(cid).x > 0 then doTeleportThing(cid, getMarkPos(cid)) doMarkPos(cid, 0, 0, 0) doPlayerSendTextMessage(cid, 21,"Você foi teleportado para o waypoint") doSendMagicEffect(pos,11) else doPlayerSendCancel(cid, "Você não gravou uma posição.") end end return TRUE end agora em talkaction.xml cole essa tag <talkaction words="!salvar;!voltar" event="script" value="funtele.lua"> Agradecimentos: DemonBholder & Apocarai(jaohd) </talkaction>
    • Por Skydangerous
      Testado no TFS 0.3.6
      A função faz pega tal coisa dentre de uma posição


      function getCreatureInRange(type, fromPos, toPos, toGet, itemid) local types = { ["player"] = isPlayer, ["monster"] = isMonster, ["npc"] = isNpc, ["creature"] = isCreature } local tmp = {} local type = types[type] if(not type) then print('[getCreatureInRange]>> Unknow type') return 0 end local thing = nil for x = fromPos.x, toPos.x do for y = fromPos.y, toPos.y do for z = fromPos.z, toPos.z do for s = 1, 253 do local position = {x = x, y = y, z = z, stackpos = s} thing = getTileThingByPos(position) if(type(thing.uid) == true) then table.insert(tmp, thing.uid) end end end end end if(toGet == "count") then return table.maxn(tmp) elseif(toGet == "name") then return tmp else print('[getCreatureInRange]>> Unknow creature to get') return 0 end return true end Como Usar: local fromPos = {x = 100, y = 100, z = 7, stackpos = 1} local toPos = {x = 150, y = 150, z = 7, stackpos = 1} local t = getCreatureInRange("monster", fromPos, toPos, "count") print('>> There are ' .. t .. ' monsters) Exemplo como vai retornar: local fromPos = {x = 100, y = 100, z = 7, stackpos = 1} local toPos = {x = 150, y = 150, z = 7, stackpos = 1} local t = getCreatureInRange("monster", fromPos, toPos, "name") for i = 1, table.maxn(t) do print('>> The names are ' .. getCreatureName(t[i])) end

      Exemplo como vai retornar:





      Creditos:



      darkhaos

    • Por Skydangerous
      não fique chateado por suas notas, olha a minha e seja feliz )
    • Por Skydangerous
      Veii que triste (

      quando ocorreu esse acidente, eu estava em uma festa de formatura, fiquei imaginando gritarias , gente correndo, pisando nos outros, deixando seus amigos para trás..

      caralho to triste d + (
    • Por Skydangerous
      Eu ficava mandando toda hora o site do tibia king lá pros caras acessarem, pakaokopakoa.
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo