Hello,
I have a problem. Due to the fact that the buffer is 9999, an error occurs. How do I correct this from get_statsnum () then?
Code:
public clcmd_csgo_top15( id )
{
new iStatsTotal = get_statsnum();
new gTopSort[ 9999 ][ 2 ];
new iStats[ 8 ];
new iBodyHits[ 8 ];
new szName[ MAX_NAME_LENGTH ];
for ( new i = 0 ; i < iStatsTotal ; i++ )
{
get_stats( i, iStats, iBodyHits, szName, charsmax( szName ) );
gTopSort[ i ][ 0 ] = i;
gTopSort[ i ][ 1 ] = iStats[ 0 ];
}
SortCustom2D( gTopSort, iStatsTotal, "Sort_TOP15" );
new szMotd[ MAX_MOTD_LENGTH ], iLen;
iLen = formatex( szMotd, charsmax( szMotd ), "<head><meta charset=UTF-8>\
<style>body{background: #000}table, th, td{border: 1px solid black;border-collapse: collapse;}</style></head>\
<body><table width=100%% cellpadding=2 cellspacing=0 border=1>\
<tr align=center style=color:#00c4ff><th width=20%%>#<th width=60%%>Player<th width=20%%>Kills</tr>");
for( new x = 0; x < 15; x++ )
{
get_stats( gTopSort[ x ][ 0 ], iStats, iBodyHits, szName, charsmax( szName ) );
iLen += formatex( szMotd[ iLen ], ( sizeof szMotd - 1 ) - iLen, "<tr align=center style=^"color:#fff^"><td>%d<td>%s<td>%s", x + 1, szName, gTopSort[ x ][ 1 ] );
}
iLen += formatex( szMotd[iLen], ( sizeof szMotd - 1 ) - iLen, "</body></font></pre>" );
show_motd( id, szMotd, "TOP 15" );
}