01.10.2018, 20:22
First of all you need to have column for cash in Players table. In this example, I will use cash as an column of value of cash.
So, here it is, but notice that: I don't use easy sqlite and am in a hurry, so take this code and do the same with easy sqlite.
Also notice: <DB> is the placeholder of real database (you create it first like this: new DB:dbname;)
So, here it is, but notice that: I don't use easy sqlite and am in a hurry, so take this code and do the same with easy sqlite.
PHP код:
CMD:toprich(playerid, params[])
{
new toprich, DBResult:result;
result = db_query(<DB>, "SELECT max(cash) FROM Players");
if(db_num_rows(result))
toprich = db_get_field_int(result);
db_free_result(result);
va_SendClientMessage(playerid, -1, "Max amount of cash is %d", toprich); //FROM YSI
return 1;
}