[REP++] Money over 2,000,000,000$ -
buburuzu19 - 23.02.2016
If i have more than 2,000,000,000$ in hand or bank for example money goes with -.
How can i increase this limit? I know that some servers did.
Thanks!
Re: [REP++] Money over 2,000,000,000$ -
Vince - 23.02.2016
You cannot because a 32 bit integer cannot store larger numbers. Maybe it's time to rethink your server economy instead.
The greatest number that can be stored in a 32 bit integer is:
Код:
01111111111111111111111111111111
equivalent to 2,147,483,647
The most significant bit (left most bit) stores whether the number is positive (0) or negative (1). Adding another digit to the value above makes the digits roll around and produce:
Код:
10000000000000000000000000000000
equivalent to -2,147,483,648
Re: [REP++] Money over 2,000,000,000$ -
AdmBot - 23.02.2016
I think the solution is to make 1-2 more variables for money for sum and show, not to sore in a variable.
Re: [REP++] Money over 2,000,000,000$ -
AbyssMorgan - 23.02.2016
Quote:
Originally Posted by buburuzu19
If i have more than 2,000,000,000$ in hand or bank for example money goes with -.
How can i increase this limit? I know that some servers did.
Thanks!
|
Currently, the only possible method:
https://sampforum.blast.hk/showthread.php?tid=598933
Re: [REP++] Money over 2,000,000,000$ -
buburuzu19 - 24.02.2016
Quote:
Originally Posted by AbyssMorgan
|
How can i use it? Can you give me an example of storing and showing in a string, for example pVar[playerid][pMoney] = ... ?
Thanks !
Re: [REP++] Money over 2,000,000,000$ -
AbyssMorgan - 24.02.2016
for example, for use by the bank
PHP код:
pVar[playerid][pMoney] - your variable suffix
pVar[playerid][pMoneyLY] - your variable prefix
//adding money to the bank
UpdateLY(pVar[playerid][pMoneyLY], pVar[playerid][pMoney], amount); //<-- set your amount
GivePlayerMoney(playerid,-amount);
//the payment from the bank
if(IsValueContainLY(pVar[playerid][pMoneyLY], pVar[playerid][pMoney], amount)){ //<-- set your amount
UpdateLY(pVar[playerid][pMoneyLY], pVar[playerid][pMoney], -amount);
GivePlayerMoney(playerid,amount);
} else {
//you do not have enough money
}
//The amount of money in bank
new mymoney[LY_STRING_LEN], buffer[128];
GetLYString(pVar[playerid][pMoneyLY], pVar[playerid][pMoney], mymoney);
format(buffer,sizeof buffer,"You money in bank: %s",mymoney);
SendClientMessage(playerid,-1,buffer);