why i see only richplayers if they have more than 500.000$ in the bank only ? i want in the hand too , i mean if you have 700k at you and in the bank 100k to see , not if you have only in the bank more than 500k
Код HTML:
CMD:richlist(playerid, params[])
{
if(gLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Tu nu esti logat si nu poti sa folosesti aceasta comanda!");
if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_ERROR, "Nu ai gradul necesar ca sa folosesti aceasta comanda!");
const max_sort = 20;
new string[500 + (MAX_PLAYER_NAME+1)*max_sort];
new Cache:result = mysql_query(handle, "SELECT `Name`,`Cash`,`Account`,`HoursPlayed` FROM `players` WHERE `Cash` > 500000 AND `Account` > 500000 ORDER BY `Cash` > 500000 AND `Account` > 500000 DESC LIMIT 10");
new tmp = cache_num_rows();
if(tmp)
{
strcat(string,"Nume\tBani la el\tBani in banca\tOre jucate\n");
for(new i,a[11],c[11],h[11],n[MAX_PLAYER_NAME]; i<tmp; i++)
{
cache_get_field_content(i, "Name", n);
cache_get_field_content(i, "Cash", c);
cache_get_field_content(i, "Account", a);
cache_get_field_content(i, "HoursPlayed", h);
format(string,sizeof(string),"%s%s\t%d\t%d\t%d\t%d\n",string,n,strval©,strval(a),strval(h));
}
}
cache_delete(result);
if(string[0] == EOS) return SendClientMessage(playerid, COLOR_ERROR, "Nu sunt playeri ce au peste 500.000$ la ei sau in banca");
ShowPlayerDialog(playerid, 525242, DIALOG_STYLE_TABLIST_HEADERS, "Top 10 jucatori bogati", string, "Iesi", "");
return 1;
}
PHP код:
new Cache:result = mysql_query(handle, "SELECT `Name`,`Cash`,`Account`,`HoursPlayed` FROM `players` WHERE `Cash` > 0 DESC LIMIT 10");
And, this command will only get cash which is stored in the database, if your money updates and still not saved it will show the first one untill your stats saved again