• 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!

Teleport to corpse

Joined
Jun 22, 2010
Messages
268
Solutions
1
Reaction score
5
Location
Usa, Utah
is their anyway to teleport to the place you died or any function to return that position?

im using 0.4
 
Last edited:
gonna make it a spell kind of like being rez'd or a talk action. here is what i got so far my friend helped me a lil bit.

LUA:
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

for some reason it wont register a new position, and it wont give all characters the storage value.

LUA:
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
 
Not the best way but, whatever.
LUA:
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

LUA:
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
 
Last edited:
Back
Top