• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!

Gold cap past 1 milion

Status
Not open for further replies.
Level 18
Joined
May 11, 2012
Messages
2,103
Can someone help me in creating a system that will allow players to hold more than 1 milion gold?

So if I gain 2 milion gold, and only 1 milion can be held, that other milion will be stored somewhere (probably in a variable), and you will first be using that gold in your "hidden" storage and when your storage gets empty, it starts conduction from the visible one.

And also a chat command to show the total gold.
GUI preferably. If neccessary, vJass allowed.

Thanks!
 
Level 18
Joined
May 11, 2012
Messages
2,103
I don't really understand you here. I used milions as an example. He could have 1 000 001 gold, but only 1 000 000 gold will be shown, and that 1 in hidden storage should be spent first, and then conduct from the visible storage.

And yeah, I can spend 1 million pretty fast. So it's not quite enough.
 
Last edited:
Level 25
Joined
Jul 10, 2006
Messages
3,315
That is usually the case if your cheapest item costs 1000+. Drop a few zeroes off everything and you're good for another few digits.

One way to do it:
Periodic trigger that compares your current gold with the last checked gold (set this value later in the trigger).
If it's higher than some value, e.g. 900000, calculate the difference and save that to an integer. If it's lower than some other value, e.g. 800000, put some of the saved gold back.
 
Status
Not open for further replies.
Top