17.02.2017, 22:36
Hey guys i have this /richlist command i want to do only for players so if an admin/helper have like 10.000.000$ and a normal player have 8kk that player should be first not that admin/helper with 10kk
any idea?
Код 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(!IsManager(playerid)) return SendClientMessage(playerid, COLOR_ERROR, "Nu ai gradul necesar ca sa folosesti aceasta comanda!"); const max_sort = 10; new string[500 + (MAX_PLAYER_NAME+1)*max_sort]; new Cache:result = mysql_query(handle, "SELECT `Name`,`Cash`,`Account`,`HoursPlayed` FROM `players` WHERE `Cash` > 0 ORDER BY `Cash` DESC LIMIT 20"); 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); ShowPlayerDialog(playerid, 525242, DIALOG_STYLE_TABLIST_HEADERS, "Top 20 jucatori bogati", string, "Iesi", ""); return 1; }