load_coord:
mov [l_enable],0
cmp [z_coord],0
je originalcodeteleport
// Save actual Position (for UNDO TELEPORT) when press LOAD POSiTiON
movss xmm12,[rax+70]
movss [x_coord_undo],xmm12
movss xmm12,[rax+74]
movss [z_coord_undo],xmm12
movss xmm12,[rax+78]
movss [y_coord_undo],xmm12
// Save actual Position (for UNDO TELEPORT) when press LOAD POSiTiON
movss xmm12,[x_coord]
movss [rax+70],xmm12
movss xmm12,[z_coord]
movss [rax+74],xmm12
movss xmm12,[y_coord]
movss [rax+78],xmm12
jmp originalcodeteleport
function UnfreezeLocationPresetsTimer()
PreTimer = createTimer(nil)
PreTimer.OnTimer = UnfreezeLocationPresets
PreTimer.Interval = 100
PreTimer.Enabled = true
end
function UnfreezeLocationPresets()
if PreTimer ~= nil then PreTimer.Enabled = false; object_destroy(PreTimer); end
local Presets = CheatTable.getMemoryRecordByDescription("[Location Presets]")
for i = Presets.Count-1,0,-1 do
memoryrecord_unfreeze(Presets.Child)
end
end
function SaveLocationPreset(argx, argy, argz)
UnfreezeLocationPresetsTimer()
local LocTable = CheatTable.getMemoryRecordByDescription("[Location Presets]")
local BaseAddr = readQword(getAddress("base"))
local PlayerX, PlayerY, PlayerZ = argx, argy, argz
if not LocTable or not BaseAddr then return end
if not PlayerX then PlayerX = readFloat(BaseAddr+0x70) end
if not PlayerY then PlayerY = readFloat(BaseAddr+0x78) end
if not PlayerZ then PlayerZ = readFloat(BaseAddr+0x74) end
if not PlayerX then return end
local LocPreset = CheatTable.createMemoryRecord()
memoryrecord_appendToEntry(LocPreset,LocTable)
LocPreset.Description = 'Custom Location Preset'
LocPreset.Type = vtAutoAssembler
LocPreset.Script = "[ENABLE]\nLuaCall(SetPlayerPosition("..PlayerX..","..PlayerY..","..PlayerZ.."))\n[DISABLE]"
end
function SetPlayerPosition(argx, argy, argz)
UnfreezeLocationPresetsTimer()
local BaseAddr = readQword(getAddress("base"))
if not BaseAddr then return end
writeFloat(BaseAddr+0x70, argx)
writeFloat(BaseAddr+0x78, argy)
writeFloat(BaseAddr+0x74, argz)
end
</LuaScript>
</CheatTable>[/hide]