[Ajuda] Ranking Mysql no jogo
#6

Veja se funciona:
PHP код:
//Adicione ao topo do seu esta #define
#define DIALOG_RANK 1000
//----------------------------------------------//
//Comando abaixo, notei a falta do Dialog, apenas acrescentei o dialog.
CMD:rank(playerid,params[]) {
    new 
sG[128], name[128];
    if(
sscanf(params,"s[68]",params)) {
        
SendClientMessage(playerid,-1,"Use: /rank [option]");
        
SendClientMessage(playerid,-1,"Options: bank");
        return 
1;
    }
    new 
DialogNGL[1600];
    if(
strcmp(params,"bank",true) == 0) {
        new 
rowsfields;
        
mysql_query(ConnectMYSQL,"SELECT * FROM `accounts` ORDER BY bank DESC LIMIT 15");
        
cache_get_data(rowsfields);   
        for(new 
rrowsr++) {
            if(
== 1) { // primeiro lugar cor: ouro
                
cache_get_field_content(r"Username",name);
                
format(sG,sizeof(sG), "{FFFF00}%i- %s - $%d\n"rname,cache_get_field_content_int(r"bank"));
                
strcat(DialogNGL,sG);
            }
            else if(
== 2) { // primeiro lugar cor: prata
                
cache_get_field_content(r"Username",name);
                
format(sG,sizeof(sG), "{80FFFF}%i- %s - $%d\n"rname,cache_get_field_content_int(r"bank"));
                
strcat(DialogNGL,sG);
            }
            else if(
== 3) { // primeiro lugar cor: bronze
                
cache_get_field_content(r"Username",name);
                
format(sG,sizeof(sG), "{80FFFF}%i- %s - $%d\n"rname,cache_get_field_content_int(r"bank"));
                
strcat(DialogNGL,sG);
            }
            else { 
// cor normal
                
cache_get_field_content(r"Username",name);
                
format(sG,sizeof(sG), "{FFFFFF}%i- %s - $%d\n"rname,cache_get_field_content_int(r"bank"));
                
strcat(DialogNGL,sG);
            }
        }
        
ShowPlayerDialog(playerid,DIALOG_RANK,DIALOG_STYLE_LIST,"Rank: Bank",DialogNGL,"Fechar","");
    }
    return 
1;

Reply


Messages In This Thread
Ranking Mysql no jogo - by gmstrikker - 30.01.2016, 14:26
Re: Ranking Mysql no jogo - by MtC - 30.01.2016, 21:54
Re: Ranking Mysql no jogo - by gmstrikker - 31.01.2016, 19:09
Re: Ranking Mysql no jogo - by MtC - 31.01.2016, 19:21
Re: Ranking Mysql no jogo - by gmstrikker - 31.01.2016, 19:43
Re: Ranking Mysql no jogo - by MtC - 01.02.2016, 01:56
Re: Ranking Mysql no jogo - by gmstrikker - 01.02.2016, 11:36
Re: Ranking Mysql no jogo - by MtC - 01.02.2016, 13:37

Forum Jump:


Users browsing this thread: 1 Guest(s)