13.02.2012, 09:19
There is one way to do this though.
Store the value to a file or to a mysql database, then upon for example /buyhouse :
For example:
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;
}
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
}