CipsoftStinks
www.relicaria.com
Hello otland
Can anyone tell me which is the code related to TP player to temple if the player its standing on unwalkable tile? [OTHIRE]
i need to add this function to OTX2 sources, because this distribution lack of this function, so players can't make teleport players in depot etc etc and other things
maybe @Peonso?
i have this functios but its a bit buggy . Because it works but if the player its o pz tiles he get teleported to its town temple :S
maybe someone can fix this?
Can anyone tell me which is the code related to TP player to temple if the player its standing on unwalkable tile? [OTHIRE]
i need to add this function to OTX2 sources, because this distribution lack of this function, so players can't make teleport players in depot etc etc and other things
maybe @Peonso?
i have this functios but its a bit buggy . Because it works but if the player its o pz tiles he get teleported to its town temple :S
maybe someone can fix this?
Code:
function isPathable(pos)
pos.stackpos = 0
local tile = getThingfromPos(pos).uid
if tile > 0 then
return not hasProperty(tile, CONST_PROP_BLOCKSOLID)
end
return false
end
local function isWalkable(cid, pos) -- DOES NOT WORK WITH ACCESS 3+
local closest = getClosestFreeTile(cid, pos)
return type(closest) == "table" and doComparePositions(closest, pos)
end
function onLogin(cid)
local position = getThingPos(cid)
if isPathable(position) == false or isWalkable(cid, position) == false then
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
end
return true
end