I need some help [Money problem in game]
#1

Hi , i have a question about bank money in player stats.How can i expend the bank money limit ? ex on my server if a player has $2,100,000,000 in bank or cash , money will be in minus ( $-2,100,000,000 ) how can i expand the limit for example to $ 10,000,000,000 in bank and cash $ 5,000,000,000 ? thanks.

P.S. Sorry for my bad english.
Reply
#2

Cant, after a while big numbers go negative
Reply
#3

Quote:
Originally Posted by milanosie
Посмотреть сообщение
Cant, after a while big numbers go negative
ok, thx for help
Reply
#4

Quote:
Originally Posted by R3pp3ru92
Посмотреть сообщение
ok, thx for help
There is one way to do this though.

Store the value to a file or to a mysql database, then upon for example /buyhouse :

pawn Код:
stock GetPlayerBigMoney(playerid, Amount)
{
      new Query[150]; // Note this variable is set to 150, so it can contain large amount, though if your amount of money exceeds 79 chars you would have to extend this value to over 150 :)
      format(Query, sizeof(Query), "SELECT * FROM users_info WHERE money >= %d AND username = '%s';", Amount, GetPlayerNameEx(playerid));
      mysql_query(Query);
      mysql_store_result(Query);
      if(!mysql_num_rows()) return 0;
      return 1;
}
For example:

pawn Код:
if(!GetPlayerBigMoney(playerid, 100000000000)) SendClientMessage(playerid, COLOR_INFO, "You need at least 100,000,000,000 to buy this object!");
else
{
     // Let the user buy the object / car whatever
}
Reply
#5

so , GetPlayerBigMoney , can i create a command that sets the player max money amount? this is what i am interested to do , because on my server , players make money easely and in one or two monts they have over 2kkk
( $ 2,000,000,000 ) and this is the problem , because money became negative.
Reply
#6

Quote:
Originally Posted by R3pp3ru92
Посмотреть сообщение
so , GetPlayerBigMoney , can i create a command that sets the player max money amount? this is what i am interested to do , because on my server , players make money easely and in one or two monts they have over 2kkk
( $ 2,000,000,000 ) and this is the problem , because money became negative.
Yes, storing the value in flatfiles or mysql could help you solve this problem.
Reply
#7

Or, make like 5 or 6 bank accounts in their playerfile instead of one, and when they try to deposit in the first one, if there is already too much, they have to deposit in other.
Reply
#8

umm wait
you can create a textdraw if you want to
Reply
#9

Quote:
Originally Posted by ricardo178
Посмотреть сообщение
Or, make like 5 or 6 bank accounts in their playerfile instead of one, and when they try to deposit in the first one, if there is already too much, they have to deposit in other.
it's a great ideea , thx
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)