SA-MP Forums Archive
[ Help ] GetPlayerMoney - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [ Help ] GetPlayerMoney (/showthread.php?tid=321848)



GetPlayerMoney - Konstantinos - 28.02.2012

Hi. I made a bank system this week and all the parts work as I want. Although, today I notice a problem on Deposit.
It gets player's money but if someone has more than $999,999,999 it saves that money and the rest not.
Because I know about the variables that the max value can store is 2,147,483,647 and I just want to prevent this.
So, I made it just reading from the Database and do the mathematical operations then store it on a string.
The only problem is that it gets the money (GetPlayerMoney( playerid )) + (inputtext) to deposit the money and save them.
Is there any way to get player's money without using GetPlayerMoney( playerid ) function and can get more than 1 Billion?

Regards,


Re: [ Help ] GetPlayerMoney - iPLEOMAX - 28.02.2012

Only way would be to create a server-sided money variable. The native GetPlayerMoney won't return more than the default GTA money anyway...


Re: [ Help ] GetPlayerMoney - Konstantinos - 28.02.2012

If I do this, the variables will be 32bits, isn't it?
It will store again 2,147,483,647. Unless, I am wrong. Can you explain what do you mean iPLEOMAX?


Re: [ Help ] GetPlayerMoney - iPLEOMAX - 28.02.2012

Quote:
Originally Posted by Dwane
Посмотреть сообщение
If I do this, the variables will be 32bits, isn't it?
It will store again 2,147,483,647. Unless, I am wrong. Can you explain what do you mean iPLEOMAX?
Oh sorry, I misunderstood your question earlier.

But, It's not possible AFAIK.
Let me do some research, I'll notify you If I discover something.


Re: [ Help ] GetPlayerMoney - Konstantinos - 28.02.2012

Okay, Thanks!
However, it's possible because I have seen this in a SA-MP Server which it was using MySQL.
I will search too, thanks for your time.


Re: [ Help ] GetPlayerMoney - iPLEOMAX - 28.02.2012

Quote:
Originally Posted by Dwane
Посмотреть сообщение
Okay, Thanks!
However, it's possible because I have seen this in a SA-MP Server which it was using MySQL.
I will search too, thanks for your time.
I'm not sure, in that case, the server scripter might have built a custom system to do mathwork with numbers in strings.


Re: [ Help ] GetPlayerMoney - Twisted_Insane - 28.02.2012

Why you even want it for? I mean, most servers I've seen ban the player automatically if his money reaches the limit from $999,999,999!


Re: [ Help ] GetPlayerMoney - milanosie - 28.02.2012

Like PlayerInfo[playerid][Money]


Re: [ Help ] GetPlayerMoney - Konstantinos - 28.02.2012

Quote:
Originally Posted by iPLEOMAX
Посмотреть сообщение
I'm not sure, in that case, the server scripter might have built a custom system to do mathwork with numbers in strings.
I guess he did, because he was very good but he quited SA-MP.
On the Withdraw Part, I am using strings too and do the addition or removal and then I get strval from the string and save it on the Database. I can withdraw the max I have tested 7 billions. I am sure there is a way and I am going to hit my head down to find it ()

Quote:
Originally Posted by Twisted_Insane
Посмотреть сообщение
Why you even want it for? I mean, most servers I've seen ban the player automatically if his money reaches the limit from $999,999,999!
In the RolePlay Servers maybe. But I like Freeroam. I had 19 billions on a server I played and that's the nice thing.

Quote:
Originally Posted by milanosie
Посмотреть сообщение
Like PlayerInfo[playerid][Money]
This Variable can get the limit I mentioned above. That's why I prevented to use any variable.