// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .cs}
//-------------MAIN---------------
0000: NOP
0662: printstring "PopandauL"
thread 'PMT'
if
33@ = SAMP.Base()
else_jump @PMT_44
0A93: end_custom_thread
:PMT_44
wait 400
SAMP.Available
else_jump @PMT_44
wait 0
if and
8AAB: not file_exists "CLEO\Teleports.ini"
8AAB: not file_exists "CLEO\TeleportSettings.ini"
else_jump @PMT_203
wait 3000
chatmsg "[{BAFF00}PMT{FFFFFF}]: One of the ini files is missing." 16777215
0A93: end_custom_thread
jump @PMT_394
:PMT_203
wait 3000
chatmsg "[{BAFF00}PMT{FFFFFF}]: Teleport.cs by {00B5FF}PopandauL {FFFFFF}was successfully loaded." 16777215
0AF0: 29@ = get_int_from_ini_file "cleo\TeleportSettings.ini" section "Keys" key "Key1"
0AF0: 28@ = get_int_from_ini_file "cleo\TeleportSettings.ini" section "Keys" key "Key2"
:PMT_394
wait 0
0B34: samp register_client_command "ptp" to_label @PMT_627
0B34: samp register_client_command "pcp" to_label @PMT_888
0B34: samp register_client_command "ptpc" to_label @PMT_1072
0B34: samp register_client_command "pspos" to_label @PMT_1150
0B34: samp register_client_command "plpos" to_label @PMT_1381
0B34: samp register_client_command "pback" to_label @PMT_1802
0B34: samp register_client_command "pmthelp" to_label @PMT_1981
:PMT_493
wait 0
if
Player.Defined($PLAYER_ACTOR)
else_jump @PMT_620
0A8D: 12@ = read_memory 12216180 size 1 virtual_protect 0
if and
key_down 28@
key_down 29@
not 12@ == 0
else_jump @PMT_620
0AB6: store_target_marker_coords_to 5@ 6@ 7@ // IF and SET
Actor.StorePos($PLAYER_ACTOR, 9@, 10@, 11@)
04E4: refresh_game_renderer_at 5@ 6@
Camera.SetAtPos(5@, 6@, 7@)
Actor.PutAt($PLAYER_ACTOR, 5@, 6@, -100.0)
wait 500
:PMT_620
jump @PMT_493
:PMT_627
wait 0
SAMP.IsCommandTyped(0@)
if
0AD4: 30@ = scan_string 0@ format "%d" 0@
else_jump @PMT_829
if
SAMP.IsPlayerConnected(0@)
else_jump @PMT_768
if
4@ = SAMP.GetActorHandleByPlayerID(0@)
else_jump @PMT_719
SAMP.GetStreamedOutPlayerPos(0@, 1@, 2@, 3@)
jump @PMT_733
:PMT_719
Actor.StorePos(4@, 1@, 2@, 3@)
:PMT_733
Actor.StorePos($PLAYER_ACTOR, 9@, 10@, 11@)
Actor.PutAt($PLAYER_ACTOR, 1@, 2@, 3@)
jump @PMT_822
:PMT_768
chatmsg "[{BAFF00}PMT{E3E3E3}]: Player not connected." 14935011
:PMT_822
jump @PMT_886
:PMT_829
chatmsg "[{BAFF00}PMT{E3E3E3}]: Please enter a valid ID." 14935011
:PMT_886
SAMP.CmdRet
:PMT_888
wait 0
17@ = 0
13@ = 0
:PMT_906
if
call @PMT_2444 1 13@ 14@ 15@ 16@
else_jump @PMT_974
17@ = 1
Actor.StorePos($PLAYER_ACTOR, 9@, 10@, 11@)
Actor.PutAt($PLAYER_ACTOR, 14@, 15@, 16@)
:PMT_974
13@ += 1
13@ > 32
else_jump @PMT_906
if
17@ == 0
else_jump @PMT_1070
chatmsg "[{BAFF00}PMT{E3E3E3}]: No checkpoint was found." 14935011
:PMT_1070
SAMP.CmdRet
:PMT_1072
wait 0
SAMP.IsCommandTyped(0@)
if
0AD4: 30@ = scan_string 0@ format "%f %f %f" 1@ 2@ 3@
else_jump @PMT_1148
Actor.StorePos($PLAYER_ACTOR, 9@, 10@, 11@)
Actor.PutAt($PLAYER_ACTOR, 1@, 2@, 3@)
:PMT_1148
SAMP.CmdRet
:PMT_1150
wait 0
SAMP.IsCommandTyped(0@)
if
0AD4: 30@ = scan_string 0@ format "%d" 0@
else_jump @PMT_1313
Actor.StorePos($PLAYER_ACTOR, 1@, 2@, 3@)
format 4@v "%d" 0@
0AF3: write_float 1@ to_ini_file "cleo\Teleports.ini" section 4@v key "X"
0AF3: write_float 2@ to_ini_file "cleo\Teleports.ini" section 4@v key "Y"
0AF3: write_float 3@ to_ini_file "cleo\Teleports.ini" section 4@v key "Z"
jump @PMT_1379
:PMT_1313
chatmsg "[{BAFF00}PMT{E3E3E3}]: Please enter a valid teleport ID." 14935011
:PMT_1379
SAMP.CmdRet
:PMT_1381
wait 0
if
0AAB: file_exists "cleo\Teleports.ini"
else_jump @PMT_1739
SAMP.IsCommandTyped(0@)
if
0AD4: 30@ = scan_string 0@ format "%d" 0@
else_jump @PMT_1666
format 4@v "%d" 0@
if and
0AF2: 1@ = get_float_from_ini_file "cleo\Teleports.ini" section 4@v key "X"
0AF2: 2@ = get_float_from_ini_file "cleo\Teleports.ini" section 4@v key "Y"
0AF2: 3@ = get_float_from_ini_file "cleo\Teleports.ini" section 4@v key "Z"
else_jump @PMT_1602
Actor.StorePos($PLAYER_ACTOR, 9@, 10@, 11@)
Actor.PutAt($PLAYER_ACTOR, 1@, 2@, 3@)
jump @PMT_1659
:PMT_1602
chatmsg "[{BAFF00}PMT{E3E3E3}]: Not a valid teleport ID." 14935011
:PMT_1659
jump @PMT_1732
:PMT_1666
chatmsg "[{BAFF00}PMT{E3E3E3}]: Please enter a valid teleport ID." 14935011
:PMT_1732
jump @PMT_1800
:PMT_1739
chatmsg "[{BAFF00}PMT{E3E3E3}]: Teleports.ini was not found." 14935011
:PMT_1800
SAMP.CmdRet
:PMT_1802
wait 0
if and
not 9@ == 0.0
not 10@ == 0.0
not 11@ == 0.0
else_jump @PMT_1906
0087: 18@ = 9@ // (float)
0087: 19@ = 10@ // (float)
0087: 20@ = 11@ // (float)
Actor.StorePos($PLAYER_ACTOR, 9@, 10@, 11@)
Actor.PutAt($PLAYER_ACTOR, 18@, 19@, 20@)
jump @PMT_1979
:PMT_1906
chatmsg "[{BAFF00}PMT{E3E3E3}]: A valid previous position was not found." 14935011
:PMT_1979
SAMP.CmdRet
:PMT_1981
wait 0
0AC6: 20@ = label @PMT_2033 offset
SAMP.ShowDialog(2, "Mod by PopandauL", 20@, "Close", "", DIALOG_STYLE_MSGBOX)
SAMP.CmdRet
:PMT_2033
hex
"{FFFFFF}Commands:" 0A
"{02F6EB}/ptp{C0FF01}: teleport to a player (eg. /ptp 10)." 0A
"{02F6EB}/pcp{C0FF01}: teleport to checkpoint (eg. /pcp)." 0A
"{02F6EB}/ptpc{C0FF01}: teleport to coordinates (eg. /ptpc 100.0 100.0 250.0)." 0A
"{02F6EB}/pspos{C0FF01}: save a position under a decimal name (eg. /pspos 2)." 0A
"{02F6EB}/plpos{C0FF01}: load a position (eg. /plpos 2)." 0A
"{02F6EB}/pback{C0FF01}: teleport back to your last position." 00
end
:PMT_2444
0@ *= 160
0@ += 13098328
0@ += 48
0A8D: 1@ = read_memory 0@ size 4 virtual_protect 0
0@ += 4
0A8D: 2@ = read_memory 0@ size 4 virtual_protect 0
0@ += 4
0A8D: 3@ = read_memory 0@ size 4 virtual_protect 0
0@ += 26
0A8D: 4@ = read_memory 0@ size 1 virtual_protect 0
if and
not 1@ == 0.0
not 2@ == 0.0
not 1@ == 1099.551
not 2@ == 1601.497
not 1@ == 2695.624
not 2@ == -1704.688
4@ == 1
else_jump @PMT_2625
return_true
jump @PMT_2627
:PMT_2625
return_false
:PMT_2627
ret 3 1@ 2@ 3@