I need some help [Money problem in game]
#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


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)