from_x = 0
from_y = 0
from_z = 0
function onStepIn(cid, item, position, fromPosition)
from_x = fromPosition.x
from_y = fromPosition.y
from_z = fromPosition.z
return TRUE
end
function onStepOut(cid, item)
if getPlayerGroupId(cid) < 3 then
if getPlayerLevel(cid) >= 200 and doPlayerRemoveMoney (cid, ((getPlayerLevel(cid) - 19) * 12)) == 1 then
doPlayerRemoveMoney (cid, ((getPlayerLevel(cid) - 19) * 12))
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "You paid " .. ((getPlayerLevel(cid) - 19) * 12) .. " gps for using teleport instead of walking.")
doCreatureSay ( cid, "DedicatedOT TP rox!", TALKTYPE_ORANGE_1 )
elseif getPlayerLevel(cid) >= 200 and doPlayerRemoveMoney (cid, ((getPlayerLevel(cid) - 19) * 12)) < 1 then
doPlayerSendCancel(cid, "You need " .. ((getPlayerLevel(cid) - 19) * 12) .. " gps to use this teleport.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You need " .. ((getPlayerLevel(cid) - 19) * 12) .. " gps to use this teleport.")
doTeleportThing(cid, {x=(from_x), y = (from_y), z = from_z})
doCreatureSay(cid,"I don't have enought money for TP!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getCreaturePos(cid), 10)
else
doCreatureSay ( cid, "DedicatedOT TP rox!", TALKTYPE_ORANGE_1 )
end
else
doCreatureSay(cid, "Praise Admin Arnold! GMs get TP free!", TALKTYPE_ORANGE_1)
end
return TRUE
end