top 10 query mysql
#9

I don't believe you can format in the strcat function.
You can continue using format in your case. The first line needs to be the header line, separate the headers with \t, add \n at the end of the line, pass the string to the dialog and you're good.

I think this should work for you. I added the formatting for the first line and then just added tabs to your string.
PHP код:
CMD:top10(playeridparams[]) 

    new 
gString[900]; 
    
mysql_query(g_SQL,  "SELECT * FROM players  WHERE `respect` > 0 ORDER BY `respect` DESC LIMIT 10"); 
    new 
rows cache_num_rows(); 
    if (
rows
    {
        
format(gStringsizeof(gString), "{ff99cc}Nickname\t{ffffff}Respect\tKills\n"get_nameget_respectget_kills); 
        for (new 
0rows++) 
        { 
            new 
get_name[MAX_PLAYER_NAME], get_respect 0get_kills 0
            
cache_get_value(i"username"get_nameMAX_PLAYER_NAME); 
            
cache_get_value_int(i"respect"get_respect); 
            
cache_get_value_int(i"kills"get_kills); 
             
            
format(gStringsizeof(gString), "%s{ff99cc}%s\t{ffffff}(%d)\t(%d)\n"gStringget_nameget_respectget_kills); 
        } 
        
ShowPlayerDialog(playeridDIALOG_TOPDIALOG_STYLE_TABLIST_HEADERS"Top 10 LSDM players"gString"Ok"""); 
         
        
format(gStringsizeof(gString), "{99ff66}(INFO) %s ( %d ) is viewing /top10 table."PlayerName[playerid], playerid); 
        
SendClientMessageToAll(-1gString); 
    } 
    return 
1

Reply


Messages In This Thread
top 10 query mysql - by wallen - 11.03.2018, 14:53
Re: top 10 query mysql - by AdamsLT - 11.03.2018, 15:07
Re: top 10 query mysql - by MBJ - 11.03.2018, 15:12
Re: top 10 query mysql - by Gammix - 11.03.2018, 16:17
Re: top 10 query mysql - by wallen - 11.03.2018, 17:09
Re: top 10 query mysql - by alanhutch - 11.03.2018, 17:20
Re: top 10 query mysql - by wallen - 11.03.2018, 17:28
Re: top 10 query mysql - by Gammix - 11.03.2018, 18:03
Re: top 10 query mysql - by AdamsLT - 11.03.2018, 18:08
Re: top 10 query mysql - by wallen - 11.03.2018, 18:13

Forum Jump:


Users browsing this thread: 1 Guest(s)