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

Why money counter caps at 999999999?


Tetramur
 Share

Recommended Posts

It is well-known that in GTA SA the highest quantity of money you can have is 999999999. Why is it so and how I can make it cap at another value (say, 2147483647) by editing game exe-file?

Edited by Tetramur
Link to comment
Share on other sites

static int CPlayerInfo::Process(CPlayerInfo *playaInfo, int number) {   //  0x56F8D0
    //  some function stuff ...
    //  money stuff:
	int playaMoney = playaInfo->m_nMoney;
	if (playaMoney >= 999999999) {
		playaMoney = 999999999;
	}
	
	playaInfo->m_nMoney = playaMoney;
	int AddedMoney = playaInfo->m_nDisplayMoney;
	if (AddedMoney >= 999999999) {
		AddedMoney = 999999999;
		playaInfo->m_nDisplayMoney = AddedMoney;
	}
    return AddedMoney;
}

999999999 = 0x3B9AC9FF = FF C9 9A 3B

Binary search for FF C9 9A 3B provides 4 results only (all 4 are used for the money limit):

injector::WriteMemory<DWORD>(0x571781 + 1, 0x7FFFFFFF);
injector::WriteMemory<DWORD>(0x571788 + 1, 0x7FFFFFFF);
injector::WriteMemory<DWORD>(0x571799 + 1, 0x7FFFFFFF);
injector::WriteMemory<DWORD>(0x5717A0 + 1, 0x7FFFFFFF);

 

Link to comment
Share on other sites

You explained why I couldn't find these bytes. I thought I should look for them in plain format: 999999999 = 0x3B9AC9FF = 3B 9A C9 FF. But it turned out that I should look for them in reverse as you said. Thank you. I will test various values for this limit especially FF FF FF 7F (0x7FFFFFFF = 2147483647). By the way, if I try to have more money than $2147483647, does that mean that entire sum will go negative? 

Edited by Tetramur
Link to comment
Share on other sites

On 2/15/2021 at 2:28 AM, Tetramur said:

By the way, if I try to have more money than $2147483647, does that mean that entire sum will go negative? 

 

If I remember correctly, the value will "wrap around" (reset to 0) kind of like how an odometer will reset to 0 after reaching 999999. 

Link to comment
Share on other sites

7 hours ago, zyenapz said:

 

If I remember correctly, the value will "wrap around" (reset to 0) kind of like how an odometer will reset to 0 after reaching 999999. 

I tested it by loading a save game while I already had $999.999.999. I edited exe file as I stated.

1. When I sat in a taxi (this action alone adds $12), I started to have $1.000.000.011. 

2. I could get to the limit using Crazy Trainer and burglary submission. I achieved $2.147.483.647 but now I have to be extremely careful about this limit and sum of rewards if I work with 13.37% Master Saves because I tried to transcend this limit of $2.1B and it went to negative values. This is thing to be avoided. 

This has consequences as increasing money by $5.000 adds 1 point to criminal rating, so you can have a theoretical limit of 429.496 points of CR. But if you transcend the limit, CR will be also gone. 

Link to comment
Share on other sites

55 minutes ago, Tetramur said:

I tested it by loading a save game while I already had $999.999.999. I edited exe file as I stated.

1. When I sat in a taxi (this action alone adds $12), I started to have $1.000.000.011. 

2. I could get to the limit using Crazy Trainer and burglary submission. I achieved $2.147.483.647 but now I have to be extremely careful about this limit and sum of rewards if I work with 13.37% Master Saves because I tried to transcend this limit of $2.1B and it went to negative values. This is thing to be avoided. 

This has consequences as increasing money by $5.000 adds 1 point to criminal rating, so you can have a theoretical limit of 429.496 points of CR. But if you transcend the limit, CR will be also gone. 

That sounds bad. That's the reason for the 999,999,999 limit - to prevent people from reaching the actual limit of the 32-bit integer, which can make the game do all sorts of weird stuff.

Link to comment
Share on other sites

2 hours ago, zyenapz said:

That sounds bad. That's the reason for the 999,999,999 limit - to prevent people from reaching the actual limit of the 32-bit integer, which can make the game do all sorts of weird stuff.

When you repeatedly do Vigilante submission actual quantity of money eventually starts to have very interesting and highly erratic behaviour. I think it should happen at 500+ levels. Imagine this: you are near end of entire series of missions (when riots occur at LS), and you transcend this limit - this makes LV dangerous for you too as guards with serious ammo will attack you at first sight. Anyway, I want to know total sum of all rewards given by (sub-)missions which don't make part of 13.37% Master Save because any number added to $2.1B limit will negate the value.

Link to comment
Share on other sites

10 hours ago, Tetramur said:

When you repeatedly do Vigilante submission actual quantity of money eventually starts to have very interesting and highly erratic behaviour. I think it should happen at 500+ levels. 

 

I haven't checked the source code myself. However, I did experience a similar thing happening in other games like Mount and Blade: Warband. When you get past the Level 62 'limit' for example, then the whole game just breaks. When you visit the lair of an enemy faction then they will spawn infinitely because their spawn limit is tied to your level.

 

What you are experiencing when you go past 500+ levels in Vigilante might be the same thing.

Link to comment
Share on other sites

  • 1 year later...
MallyGameZ

What file do I open in the gta san adreas directory to edit the money code as seen above in Jack's post?

Edited by MallyGameZ
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.