Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

Happy Holidays from the GTANet team!

Cannot find a line of code to freeze time in OpCode search for San Andreas


deleted account
 Share

Recommended Posts

deleted account

The weather effect used for the Alpha Omega fight in a mod I'm making is very glitchy and sometimes everything, even CJ himself turns invisible. To stop this from happening I have to set the time when he appears and when his second phase is triggered, but how do I stop the clock? I've tried a line of code called pause_timer which didn't stop the clock.

 

Weather 250 is the weather I'm using, if you were wondering

 

COMING SOON

ALPHA OMEGA

b78bsLE.jpg

Link to comment
Share on other sites

0A8C: write_memory 0x969168 size 1 value 1 virtual_protect 0 //on

0A8C: write_memory 0x969168 size 1 value 0 virtual_protect 0 //off

you can use the code

Link to comment
Share on other sites

it works, this is the code on the orange sky at 23: 0
but do it anyway
add this opcode to a fast loop
00C0: set_current_time_hours_to 23 minutes_to 0

 

and secondly, these opcodes stop and pause meters in missions
014F: stop_timer $ 1923
0396: pause_timer 0

Edited by Sanmodder
Link to comment
Share on other sites

you can NOP out the function that updates the clock like this:

0A8C: write_memory 0x53BFBD size 5 value 0x90 virtual_protect 1 

To restore the function:

0A8C: write_memory 0x53BFBD size 1 value 0xE8 virtual_protect 1 0A8C: write_memory 0x53BFBE size 1 value 0x4E virtual_protect 1 0A8C: write_memory 0x53BFBF size 1 value 0x0F virtual_protect 1 0A8C: write_memory 0x53BFC0 size 1 value 0xFF virtual_protect 1 0A8C: write_memory 0x53BFC1 size 1 value 0xFF virtual_protect 1 
Edited by guru_guru
Link to comment
Share on other sites

 

you can NOP out the function that updates the clock like this:

0A8C: write_memory 0x53BFBD size 5 value 0x90 virtual_protect 1 

To restore the function:

0A8C: write_memory 0x53BFBD size 1 value 0xE8 virtual_protect 1 0A8C: write_memory 0x53BFBE size 1 value 0x4E virtual_protect 1 0A8C: write_memory 0x53BFBF size 1 value 0x0F virtual_protect 1 0A8C: write_memory 0x53BFC0 size 1 value 0xFF virtual_protect 1 0A8C: write_memory 0x53BFC1 size 1 value 0xFF virtual_protect 1 

 

Ain't that nop only the 1st byte?

Also we can't write more then 4 bytes with 0A8C at once:

 

 

0A8C: write_memory 0x53BFBD size 4 value 0x90909090 virtual_protect 1 //  4 bytes0A8C: write_memory 0x53BFC1 size 1 value 0x90 virtual_protect 1 //  5th byte

And to restore the function:

 

 

0A8C: write_memory 0x53BFBD size 4 value 0xFF0F4EE8 virtual_protect 1 //  4 bytes0A8C: write_memory 0x53BFC1 size 1 value 0xFF virtual_protect 1 //  5th byte
Link to comment
Share on other sites

Ain't that nop only the 1st byte?

 

 

Also we can't write more then 4 bytes with 0A8C at once:

 

0A8C: write_memory 0x53BFBD size 4 value 0x90909090 virtual_protect 1 //  4 bytes0A8C: write_memory 0x53BFC1 size 1 value 0x90 virtual_protect 1 //  5th byte

 

Nope,08ac acts as memory fill when using a size greater than 4.(and iirc w/ size == 3).So I'm just writing 5 consecutives NOPs.

 

 

 

And to restore the function:

0A8C: write_memory 0x53BFBD size 4 value 0xFF0F4EE8 virtual_protect 1 //  4 bytes0A8C: write_memory 0x53BFC1 size 1 value 0xFF virtual_protect 1 //  5th byte

 

I forgot how to rearrange the bytes,so that's why I wrote them one by one :p

Link to comment
Share on other sites

Jack gave you a great way to lock the clock time through memory address. But if you don't want to deal with memory addresses and such, you can use 00BF to get current hour and minutes then set a loop with 00C0 to lock it and avoid any changes. In a side note you will get weird weather changes, so I recommend to lock the weather too if you want.

Link to comment
Share on other sites

Another GTA Fan

The 'Pause Timer' code is for the timer used in missions like vigilante and paramedic, not the game clock :p

 

The best way to "freeze" the game clock is this:

{$CLEO .cs}:TEST_003A4: name_thread 'TEST':TEST_1wait 50000BF: [email protected] = current_time_hours, [email protected] = current_time_minutesif andnot [email protected] = 0not [email protected] = 0else_jump @TEST_100C0: set_current_time 0 0jump @TEST_1

Just make sure it's always looping this code so it keeps the time reseting to what you what it to be. If you want to also "lock" the weather, just insert the weather code you want under (Of above) the set current time code, and it'll keep them both the same.

 

PS. Forgive me for making simple scripts. I'm not an expert so I don't know how to use those fancy hex lines as used above. I don't want to suggest something that I'm not even familiar with, but I'm sure someone else will help you if you want to use more advanced coding.

Edited by Recommended
Link to comment
Share on other sites

deleted account

Theres another problem, when having the script jump to the time loop for some reason the game will not allow Alpha Omega to enter Phase 2 and instead dies. I do have a few ideas of how I could solve this but advice is always nice to have

 

And for anyone that wants to try Crackhead's script MAKE SURE the game has a second (wait 1000) to reset the time, or else the game will overload and crash

 

I gave up trying to figure out how to let Alpha Omega enter phase 2

Edited by SpicyDragon
Link to comment
Share on other sites

  • 4 weeks later...

My brother set up variables in the Hostel mission to create a real time mission. Keep in mind this is NOT a script but replaced the whole of the main.scm for the mod. So the variables shown here are global.

 

Initialization:

[email protected] = 1 //[email protected] = 15 //[email protected] = 0  //[email protected] = 0 00C0: set_current_time_hours_to 1 minutes_to 15

Subroutine:

:[email protected] > [email protected] += [email protected] = [email protected] == [email protected] = [email protected] += 1if [email protected] == [email protected] = [email protected] += 1 if [email protected] == [email protected] = 0end //hoursend //minsend //secondsend //ms00C0: set_current_time_hours_to [email protected] minutes_to [email protected]

This simple subroutine makes the GTA world clock slow down to real time.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.