PDA

View Full Version : [HELP] Sync Mod Garages with Server Sided Money


Camacorn
26/11/2011, 01:06 AM
Iv'e been searching forever around the forums on how to sync the Mod Garages with server sided money to make it actually take money from you, but have no luck. Does anybody know if it's possible, and if so, how?

Thank you.

Rob_Maate
26/11/2011, 01:19 AM
Well, think about it like this.
You have a mod garage that's designed to subtract money from the moneybar
That mod garage is inside it's own interior
So why not just include a section in your code that's only applicable in the Mod garage int that will store the amount of money you have when you enter the int, and then sync with the moneybar after you leave?

i can write you a demo code - i'll have to look up the ints n stuff

Camacorn
26/11/2011, 01:20 AM
Well, think about it like this.
You have a mod garage that's designed to subtract money from the moneybar
That mod garage is inside it's own interior
So why not just include a section in your code that's only applicable in the Mod garage int that will store the amount of money you have when you enter the int, and then sync with the moneybar after you leave?

i can write you a demo code - i'll have to look up the ints n stuff

That will not work, server sided money is scripted to make your money bar stay at the amount of money you have in your user file. Thus, when the garage takes money from the money bar, it will just rise back to the original amount you had.

Rob_Maate
26/11/2011, 01:30 AM
No mate, you add a special return clause that states if the player is in a certain interior, and the money bar money does not rise above the scripted money, that changes are permitted.

Did you write your script yourself?

SchurmanCQC
26/11/2011, 01:31 AM
That will not work, server sided money is scripted to make your money bar stay at the amount of money you have in your user file. Thus, when the garage takes money from the money bar, it will just rise back to the original amount you had.

His idea may work. Your 'server sided money' is a script, right?

Camacorn
26/11/2011, 01:38 AM
No mate, you add a special return clause that states if the player is in a certain interior, and the money bar money does not rise above the scripted money, that changes are permitted.

Did you write your script yourself?

Yes, my server is 100% scratch, it is only 40% done which is why i am trying to resolve the issue before it is finished. I am not an idiot when it comes to scripting, i have just never done anything Mod Garage related before.

Rob_Maate
26/11/2011, 01:44 AM
No, never said you were an idiot lmao - you just overlooked something rather basic, happens to the best of us.


Interior || Universe ID || X || Y || Z || Description || Location

Loco Low Co. || 2 || 616.7820 || -74.8151 || 997.6350 || Modding shop || Los Santos
Wheel Arch Angels || 3 || 615.2851 || -124.2390 || 997.6350 || Modding shop || San Fierro
Transfender || 1 || 617.5380 || -1.9900 || 1000.6829 || Modding shop || LS, SF, LV

Source: SA-MP Wiki



So your code would need to check if the player was within an area around those points + interiors.
If you like I can type one up for you, you just need to insert it wherever you


ResetPlayerMoney(playerid);
GivePlayerMoney(/*<script money variable*/);