kito2
www.masteria.net
I have been thinking if could be possible this:
When a player stepIn a sqm with actionID n it saves the posx on storage value a, posy on storage value b and posz on storage value z.
So when the player enters another tile with actionID m, it teleport him to the saved position?
----------------
After thinking and trying thing, is this script correct?
When a player stepIn a sqm with actionID n it saves the posx on storage value a, posy on storage value b and posz on storage value z.
So when the player enters another tile with actionID m, it teleport him to the saved position?
----------------
After thinking and trying thing, is this script correct?
LUA:
local _pos =
{
[1510] = {x = 32974, y = 32224, z = 7},
[1511] = {x = 32285, y = 31471, z = 2},
[1512] = {x = 33091, y = 32335, z = 7},
[1513] = {x = 606, y = 903, z = 7}
}
function onStepIn(cid, item, position)
local pos = getPlayerPosition(cid)
local x = pos.x
local y = pos.y
local z = pos.z
local x1 = getPlayerStorageValue(cid, 4500)
local y1 = getPlayerStorageValue(cid, 4501)
local z1 = getPlayerStorageValue(cid, 4502)
if item.aid == 9750 then
setPlayerStorageValue(cid, 4500, x)
setPlayerStorageValue(cid, 4501, y)
setPlayerStorageValue(cid, 4502, z)
doTeleportThing(cid, _pos[item.uid], FALSE)
doSendMagicEffect(pos, CONST_ME_TELEPORT)
end
if item.aid == 9755 then
doTeleportThing(cid, {x = x1, y = y1, z = z1}, FALSE)
doSendMagicEffect(pos, CONST_ME_TELEPORT)
end
return true
end
Last edited: