[ Help ] GetPlayerMoney
#1

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,
Reply
#2

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

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?
Reply
#4

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.
Reply
#5

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.
Reply
#6

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.
Reply
#7

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!
Reply
#8

Like PlayerInfo[playerid][Money]
Reply
#9

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)