• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved new dp teleport

Elgenady

Veteran OT User
Joined
Aug 5, 2011
Messages
1,638
Solutions
35
Reaction score
351
i search for new dp teleport its work like when player in hunt and want back to temple with save the hunt place exampile " player in hunt pos x,y,z and player use dp tp back to temple and when use dp teleport in temple back again to x,y,z" im use 0.4-dev 8.60 its hard or what ?
 
Last edited by a moderator:
Its definitly not "easy".
You would need to create a table in your database that would store the ´cordinates of the hunting spot and then a storage so that you check if cordinates have been saved. Maybe there are easier ways but... I have no idea.
 
@heba
I think with Talkaction it would be easier and better.
Something like !depot !back or something like that. I saw it in CTF (!join event) (!leave event)



Something like that. Maybe @Limos can help you with that. I'm at work now so I dont have time.
DON'T USE THAT, ITS JUST A EXAMPLE.-
PHP:
if param == 'join' then
if storage <= 0 then
if counter ~= configFire.maxPlayers - 1 then
doSetStorage(configFire.countPlayerStorage, 0)
for _, pid in ipairs(getPlayersOnline()) do
if getCreatureStorage(pid, configFire.storage) > 0 then
table.insert(playerJoined, pid)
doSetStorage(configFire.countPlayerStorage, #playerJoined)
end
end
local count = getStorage(configFire.countPlayerStorage)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, count == 0 and 'Back to Hunting place.'
doCreatureSetStorage(cid, configFire.storage, 1)
doCreatureSetNoMove(cid, true)
local condition = createConditionObject(CONDITION_INFIGHT,-1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You must wait 10 minuts to use it again.')
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You already in hunting place.')
end
PHP:
elseif param == 'leave' then
if storage > 0 then
doCreatureSetNoMove(cid, false)
doRemoveCondition(cid, CONDITION_INFIGHT)
doCreatureSetStorage(cid, configFire.storage, -1)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, 'You have left from hunting place.')
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You cannot leave from Hunting Place.')
end
 
Last edited:
i need this rune like this "This rune lets you teleport to the temple and back to the place where you teleported from, unless it was a quest or event zone."
 
Code:
local config = {
     storages = {82001, 82002, 82003},
     templeRange = {fromPos = {x = 90, y = 90, z = 7}, toPos = {x = 110, y = 120, z = 7}},
     templePosition = {x = 95, y = 115, z = 7}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
   local s, pos = {}, getPlayerPosition(cid)
   for x = 1, 3 do
     table.insert(s, getPlayerStorageValue(cid, config.storages[x]))
   end
   if isInRange(pos, config.templeRange.fromPos, config.templeRange.toPos) then
       if getTilePzInfo(pos) then
           if s[1] > 0 then
               doTeleportThing(cid, {x = s[1], y = s[2], z = s[3]})
               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You've been teleported back.")
               return true
           else
               doPlayerSendCancel(cid, "You have no position saved yet.")
           end
       else
           doPlayerSendCancel(cid, "Use this in pz.")
       end
       doSendMagicEffect(pos, CONST_ME_POFF)
   else
       if getCreatureCondition(cid, CONDITION_INFIGHT) then
           doPlayerSendCancel(cid, "You can't use this when you're in a fight.")
           doSendMagicEffect(pos, CONST_ME_POFF)
           return true
       end
       local q = {pos.x, pos.y, pos.z}
       for x = 1, 3 do
           setPlayerStorageValue(cid, config.storages[x], q[x])
       end
       doTeleportThing(cid, config.templePosition)
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You've been teleported to the temple, use it again to go back.")
   end
   return true
end
 
Code:
local config = {
     storages = {82001, 82002, 82003},
     templeRange = {fromPos = {x = 90, y = 90, z = 7}, toPos = {x = 110, y = 120, z = 7}},
     templePosition = {x = 95, y = 115, z = 7}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
   local s, pos = {}, getPlayerPosition(cid)
   for x = 1, 3 do
     table.insert(s, getPlayerStorageValue(cid, config.storages[x]))
   end
   if isInRange(pos, config.templeRange.fromPos, config.templeRange.toPos) then
       if getTilePzInfo(pos) then
           if s[1] > 0 then
               doTeleportThing(cid, {x = s[1], y = s[2], z = s[3]})
               doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You've been teleported back.")
               return true
           else
               doPlayerSendCancel(cid, "You have no position saved yet.")
           end
       else
           doPlayerSendCancel(cid, "Use this in pz.")
       end
       doSendMagicEffect(pos, CONST_ME_POFF)
   else
       if getCreatureCondition(cid, CONDITION_INFIGHT) then
           doPlayerSendCancel(cid, "You can't use this when you're in a fight.")
           doSendMagicEffect(pos, CONST_ME_POFF)
           return true
       end
       local q = {pos.x, pos.y, pos.z}
       for x = 1, 3 do
           setPlayerStorageValue(cid, config.storages[x], q[x])
       end
       doTeleportThing(cid, config.templePosition)
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You've been teleported to the temple, use it again to go back.")
   end
   return true
end
awesome work there limos :)
 
this line for what

templeRange = {fromPos = {x = 90, y = 90, z = 7}, toPos = {x = 110, y = 120, z = 7}},
 
its work but i need add when player use it countdown till 10 "10.9.8++" and need add exhausted time
 
Code:
local config = {
     storages = {82001, 82002, 82003},
     templeRange = {fromPos = {x = 90, y = 90, z = 7}, toPos = {x = 110, y = 120, z = 7}},
     templePosition = {x = 95, y = 115, z = 7},
     exhauststorage = 87538,
     exhausttime = 10
}

local function doTeleportPlayer(cid)
     if isPlayer(cid) then
         doTeleportThing(cid, config.templePosition)
         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You've been teleported to the temple, use it again to go back.")
         exhaustion.set(cid, config.exhauststorage, config.exhausttime)
     end
     return true
end
   
function onUse(cid, item, fromPosition, itemEx, toPosition)
     if exhaustion.check(cid, config.exhauststorage) then
         return doPlayerSendCancel(cid, "You are exhausted.")
     end
     local s, pos = {}, getPlayerPosition(cid)
     for x = 1, 3 do
         table.insert(s, getPlayerStorageValue(cid, config.storages[x]))
     end
     if isInRange(pos, config.templeRange.fromPos, config.templeRange.toPos) then
         if getTilePzInfo(pos) then
             if s[1] > 0 then
                 doTeleportThing(cid, {x = s[1], y = s[2], z = s[3]})
                 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You've been teleported back.")
                 exhaustion.set(cid, config.exhauststorage, config.exhausttime)
                 return true
             else
                 doPlayerSendCancel(cid, "You have no position saved yet.")
             end
         else
             doPlayerSendCancel(cid, "Use this in pz.")
         end
         doSendMagicEffect(pos, CONST_ME_POFF)
     else
         if getCreatureCondition(cid, CONDITION_INFIGHT) then
             doPlayerSendCancel(cid, "You can't use this when you're in a fight.")
             doSendMagicEffect(pos, CONST_ME_POFF)
             return true
         end
         local q = {pos.x, pos.y, pos.z}
         for x = 1, 3 do
             setPlayerStorageValue(cid, config.storages[x], q[x])
         end
         addEvent(doTeleportPlayer, 10 * 1000, cid)
         exhaustion.set(cid, config.exhauststorage, config.exhausttime)
         for c = 0, 9 do
             addEvent(doSendAnimatedText, c * 1000, pos, 10-c, math.random(200))
         end
     end
     return true
end
 
its work fine but when i tp from place to temple it countdown its k.. i need countdown too when use from temple to back my old place .. and need this effect with countdown and show how many
exhausttime like
return doPlayerSendCancel(cid, "You must wait x second to use it again .")
 
Last edited:
Code:
local config = {
     storages = {82001, 82002, 82003},
     templeRange = {fromPos = {x = 90, y = 90, z = 7}, toPos = {x = 110, y = 120, z = 7}},
     templePosition = {x = 95, y = 115, z = 7},
     exhauststorage = 87538,
     exhausttime = 10
}

local function doTeleportPlayer(cid, pos)
     if isPlayer(cid) then
         if pos ~= nil then
             doTeleportThing(cid, pos)
             doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You've been teleported back.")
         else
             doTeleportThing(cid, config.templePosition)
             doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You've been teleported to the temple, use it again to go back.")
         end
         exhaustion.set(cid, config.exhauststorage, config.exhausttime)
     end
     return true
end

local function doSendEffects(cid, c)
     local pos = getPlayerPosition(cid)
     doSendAnimatedText(pos, 10-c, math.random(200))
     local effects = {
         {x = pos.x - 1, y = pos.y - 1, z = pos.z},
         {x = pos.x, y = pos.y - 1, z = pos.z},
         {x = pos.x + 1, y = pos.y - 1, z = pos.z},
         {x = pos.x + 1, y = pos.y, z = pos.z},
         {x = pos.x + 1, y = pos.y + 1, z = pos.z},
         {x = pos.x, y = pos.y + 1, z = pos.z},
         {x = pos.x - 1, y = pos.y + 1, z = pos.z},
         {x = pos.x - 1, y = pos.y, z = pos.z}
     }
     for x = 1, 8 do
         ex = x+1 > 8 and 1 or x+1
         if math.mod(c, 2) == 0 or c == 0 then
             doSendDistanceShoot(effects[x], effects[ex], (effects[x].x ~= pos.x and effects[x].y ~= pos.y) and CONST_ANI_ENERGY or CONST_ANI_ENERGYBALL)
         else
             doSendDistanceShoot(effects[x], effects[ex], (effects[x].x ~= pos.x and effects[x].y ~= pos.y) and CONST_ANI_ENERGYBALL or CONST_ANI_ENERGY)
         end
     end
     return true
end
   
function onUse(cid, item, fromPosition, itemEx, toPosition)
     if exhaustion.check(cid, config.exhauststorage) then
         return doPlayerSendCancel(cid, "You need to wait "..exhaustion.get(cid, config.exhauststorage).." seconds before you can use it again.")
     end
     local s, pos = {}, getPlayerPosition(cid)
     for x = 1, 3 do
         table.insert(s, getPlayerStorageValue(cid, config.storages[x]))
     end
     if isInRange(pos, config.templeRange.fromPos, config.templeRange.toPos) then
         if getTilePzInfo(pos) then
             if s[1] > 0 then
                 addEvent(doTeleportPlayer, 10 * 1000, cid, {x = s[1], y = s[2], z = s[3]})
                 for c = 0, 9 do
                     addEvent(doSendEffects, c * 1000, cid, c)
                 end
                 exhaustion.set(cid, config.exhauststorage, config.exhausttime)
                 return true
             else
                 doPlayerSendCancel(cid, "You have no position saved yet.")
             end
         else
             doPlayerSendCancel(cid, "Use this in pz.")
         end
         doSendMagicEffect(pos, CONST_ME_POFF)
     else
         if getCreatureCondition(cid, CONDITION_INFIGHT) then
             doPlayerSendCancel(cid, "You can't use this when you're in a fight.")
             doSendMagicEffect(pos, CONST_ME_POFF)
             return true
         end
         local q = {pos.x, pos.y, pos.z}
         for x = 1, 3 do
             setPlayerStorageValue(cid, config.storages[x], q[x])
         end
         addEvent(doTeleportPlayer, 10 * 1000, cid)
         exhaustion.set(cid, config.exhauststorage, config.exhausttime)
         for c = 0, 9 do
             addEvent(doSendEffects, c * 1000, cid, c)
         end
     end
     return true
end
 
i edited it to no work in all evets in house in nopvp really thx bro
@Limos how i can make quest zone ?
 
Last edited:
Back
Top