Skip to content

Instantly share code, notes, and snippets.

@aumars
Last active June 3, 2023 11:42
Show Gist options
  • Save aumars/9896ffd7f0a55e3ce631a78e410dfb96 to your computer and use it in GitHub Desktop.
Save aumars/9896ffd7f0a55e3ce631a78e410dfb96 to your computer and use it in GitHub Desktop.
CLEO modification for GTA: SA. Drives your vehicle to the red checkpoint. Activated and deactivated by typing "GO". Includes source code.
{$CLEO .cs}
03A4: name_thread "CHECKPOINT.CS"
:MAIN
0001: wait 0 ms
00D6: if
0256: player 0 defined
004D: jump_if_false @MAIN
:ON
0001: wait 0 ms
00D6: if
0ADC: test_cheat "GO"
004D: jump_if_false @DRIVE
00D6: if
0039: 31@ == 0
004D: jump_if_false @OFF
0006: 31@ = 1
018C: play_sound 1083 at 0.0 0.0 0.0
0ACD: show_text_highpriority "Checkpoint BOT: ON" time 1000
0002: jump @DRIVE
:OFF
0006: 31@ = 0
018C: play_sound 1084 at 0.0 0.0 0.0
0ACD: show_text_highpriority "Checkpoint BOT: OFF" time 1000
0002: jump @ON
:DRIVE
00D6: if
0039: 31@ == 1
004D: jump_if_false @ON
00D6: if
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false @ON
0A8D: 1@ = read_memory 13099016 size 4 virtual_protect 0
0A8D: 2@ = read_memory 13099020 size 4 virtual_protect 0
0A8D: 3@ = read_memory 13099024 size 4 virtual_protect 0
00D6: if and
8043: not 1@ == 0.0
8043: not 2@ == 0.0
8043: not 3@ == 0.0
004D: jump_if_false @ERROR
00A0: store_actor $PLAYER_ACTOR position_to 4@ 5@ 6@
0509: 7@ = distance_between_XY 4@ 5@ and_XY 1@ 2@
0AD0: show_formatted_text_lowpriority "~w~[INFO]~w~ CHECKPOINT FOUND! ~r~%f ~w~ meters left!" time 100 7@
03C0: 0@ = actor $PLAYER_ACTOR car
00AE: set_car 0@ traffic_behaviour_to 2
0423: set_car 0@ improved_handling_to 2.0 // (float)
00AD: set_car 0@ max_speed_to 35.0
0704: car 0@ drive_to 1@ 2@ 3@
0002: jump @ON
:ERROR
0ACD: show_text_highpriority "~r~[WARNING]: ~w~ NO CHECKPOINT FOUND!" time 1337
0002: jump @ON
@ilia001
Copy link

ilia001 commented Jun 3, 2023

Is there an onfoot version for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment