Raised This Month: $ Target: $400
 0% 

Run time error 3: stack error


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
BeNq!
Senior Member
Join Date: Mar 2009
Old 01-06-2021 , 05:42   Run time error 3: stack error
Reply With Quote #1

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" );
}
BeNq! is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:07.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode