Tormented Being
Member
is their anyway to teleport to the place you died or any function to return that position?
im using 0.4
im using 0.4
Last edited:
function onDeath(cid) if (isPlayer(cid) == TRUE) then
--Death function
--Death function
pos = getCreaturePosition(cid)
setPlayerStorageValue(cid, "deathpos", "deathpos;".. pos.x ..";".. pos.y ..";".. pos.z .."")
-------------------
end
return true
end
function onSay(cid, words, param)
--Revive function
local t = string.explode(getPlayerStorageValue(cid, "deathpos"), ";")
if(t[4]) then
doTeleportThing(cid, {x= t[2], y = t[3], z = t[4]})
end
----------------
return true
end
function onDeath(cid, killer)
local t = {
[1] = {3900, getCreaturePosition(cid).x},
[2] = {3901, getCreaturePosition(cid).y},
[3] = {3902, getCreaturePosition(cid).z}
}
if isPlayer(cid) then
for v = t[1], #t do
setPlayerStorageValue(cid, v[1], v[2])
end
end
return TRUE
end
function onSay(cid, words, param, channel)
local x = getPlayerStorageValue(cid, 3900)
local y = getPlayerStorageValue(cid, 3901)
local z = getPlayerStorageValue(cid, 3902)
local pos = {x=x, y=y, z=z}
doTeleportThing(cid, pos)
return TRUE
end