I have spent countless hours in GTA San Andreas, going through the story missions again and again. It sure took a few hours to get through the entire game. Yet at no point did I ever imagine that someone would break the game so thoroughly that beating GTA San Andreas in 10 minutes is possible.

The speedrunning community discovered a glitch that allows you to skip directly to the final mission right from the beginning. This article will explore the hows and whys behind this glitch to fully understand what an incredible discovery the community has made.

Note: This glitch only works on the Windows version of the game.

How does the scripting work in GTA San Andreas?

gta san andreas hunter san fiero

As per many games out there, GTA San Andreas utilises multiple concurrent script threads that are executed based on actions you perform in the game. For instance, walking into a mission marker will launch a thread containing instructions on how the world should behave.

While inside a mission, the game locks other missions and certain features to prevent soft locking or unintended behaviours. This is when the game's code flags that you are in "OnMission = 1", a boolean indicating whether you're currently playing a mission or not.

Concurrently, codes need to run smoothly, efficiently, and be compact in size in order not to overload the hardware. Therefore, the game utilises compiled script commands and opcodes when executing lines in the game.

Script Commands and Opcodes

los santos

Essentially, an opcode is a short line of letters and/or text that represents a specific command for the game to execute. This is so that the game doesn't print long strings of code, which would be heavier for the engine to process. The opcode is followed by a parameter, usually containing an object ID, a string, numbers, etc. A decompiled script may look like this:

  1. 0001: wait
  2. 00BA: text_styled 'MISSION PASSED!' 1000 ms 4
  3. 004E: end_thread

But since most games are compiled, they would look something similar to this:

  1. 0001 0000
  2. 00BA 0010 'MISSION PASSED!' 03E8 0004
  3. 004E

Instruction Pointer (IP) and Jumps

 las venturas

The game's threads have instruction pointers (IP) to navigate through the scripts. In a nutshell, this is necessary for the engine to track where it currently is in the script and what it should perform next. As my sample scripts above follow a clear sequence, they do not always follow a perfect sequence since GOTO, Jump, and IF statements can be made, which changes the IP location. This is also the part where we perform the major glitch.

Arbitrary Jump in Script (AJS)

Here comes the tricky part in understanding the glitch. There is a slight flaw in the Windows version of GTA San Andreas that allows the player to jump anywhere in the game, thanks to an issue with the code. 

{2974507} 008B: 80@ = $CURRENT_TIME_IN_MS2

The code will begin running at offset 2974510 (5775 local offset in the COPCAR script), skipping the first 3 bytes of code (the opcode and the parameter type).

Thus, it uses 80@ as an opcode, which is the 0050 opcode (gosub). Then it uses the value of $CURRENT_TIME_IN_MS2 as a jump destination. 

- u/Powdinet on Reddit

The IP (2974507) is supposed to command the script to identify the opcode (008B) with the parameter values (80@ = $CURRENT_TIME_IN_MS2). The issue is that the IP starts at offset 2974510, meaning it now treats 80@ as an opcode and $CURRENT_TIME_IN_MS2 as a destination to jump. By other means, the time in milliseconds ultimately determines where you'll GOSUB. This gives you the power to jump anywhere in the script, but only if you precisely time it.

Coincidentally, the local variable @80 becomes misinterpreted in memory as opcode 0050, which commands the game to "GOSUB". And for those who don't know what GOSUB means, it's a command that tells the script to jump to a new line of script, but it remembers where you are now, and you can return later on.

How to Perform the Glitch

gta san andreas los santos gang war

As you might have guessed, the glitch ideally needs to be started immediately after you gain control of CJ. Thereon, it's all frame-perfect inputs, and as any speedrunner would do, race against the clock.

Here's a breakdown of the crucial steps:

Obtain a cop bike and start a vigilante mission as soon as possible. Cancel when in-game timer hits 82070ms - 82093ms (around 7.46 AM in-game)

Remember that $CURRENT_TIME_IN_MS2 is the GOSUB? This is where we set up the jump. When the in-game timer hits 82070ms - 82093ms, this will be the last update of the timer, and we need to keep it so. Several objects and activities can update the timer, hence, we need to avoid them, such as being too close to a vending machine. 

Pick up grenades, save the cop bike in the Grove Street garage and do the Big Smoke mission, as per usual.

We need the grenades further into the process. We need to save the cop bike since we need to start a vigilante mission in the very final step. Big smoke must be done first.

Go to the arcade machine to achieve OnMission=0

In order to perform the actual jump, we need to be in an OnMission=0 state, meaning we have to duplicate missions. When cancelling and restarting a Go Go Space Monkey arcade, we can gain control of CJ outside the arcade while it's still running. By killing yourself in-game with the grenades we picked up, while having the arcade running, we can achieve OnMission=0. 

Do Ryder while OnMission=0

Now that we have tricked the system by thinking we are not in a mission (OnMission=0 state), we can go ahead and do the Ryder mission. 

Get the haircut as part of the mission and exit the barber shop. Go inside and exit again to regain control of CJ

As per usual, we get the haircut, exit, but go inside again to regain camera control, as the first time you leave, the camera's position is fixed. Essentially, we are controlling CJ while running a cutscene simultaneously. 

While outside, run to the Ryder mission marker again 

As we leave the barber for the final time, we have to start a vigilante mission at a specific part of the cutscene. This has to occur 1000ms after Ryder's line ends, but before 1000ms have elapsed. So by running and pausing frequently, we reset Ryder's line, and we can do that indefinitely.

While running the Ryder mission again, blow up his car and start a vigilante 

While duping the Ryder mission, we need to blow up his car (with the grenades) while starting a vigilante with the cop bike you saved in the garage. If timed correctly, the jump should be executed and End of the Line Part 3 starts.


As you can probably tell, so many things can go wrong, and so it may. This strategy is highly complex and requires flawless execution. From the very first vigilante mission cancellation, it's impossible to tell immediately whether you hit the correct frame - you'll only find out later during the sequence.

It may be difficult to grasp everything just by reading, but the following video can give you an idea of what a run may look like. Speedrunner Joshimuz pulled it off in an impressive 15:37.

Say something here...
characters left.
Log in with
or post as a guest
Loading comment... The comment will be refreshed after 00:00.

Remove Ads with VIP Membership!

You can support us by becoming a VIP Member to enjoy an ad-free experience and extra features for a small fee.

Work With Us - Join The Team!

We're looking for new staff members with passion for GTA and Rockstar Games, and willingness to contribute in any of the website areas. If you're interested, feel free to contact us!