CMD:checkreports( playerid, params[] )
{
#pragma unused params
new
String[ 128 ],
rePath[ 32 ];
if( IsPlayerAdmin( playerid ) )
{
for( new re; re < FindLastReportID( ); re-- )
{
format( rePath, sizeof( rePath ), "Logs/Reports/Report%d.ini", re );
if(fexist( rePath ) )
{
INI_ParseFile( rePath, "LoadReports_%s", .bExtra = true, .extra = re);
format( String, sizeof( String ), "[R#%d (%s)] %s: "#WHITE"%s", re, reportInfo[ re ][ ReportTime ], reportInfo[ re ][ Reporter ], reportInfo[ re ][ ReportText ] );
SendClientMessage( playerid, c_LIME, String );
}
}
}
return true;
}
assume FindLastReportID is 1 re is initialized to 0 0 smaller than 1 loop runs re is decremented re is now -1 -1 still smaller than 1 loop runs re is decremented re is now -2 -2 still smaller than 1 loop runs ...
Ye, infinite loop obviously.
Код:
assume FindLastReportID is 1 re is initialized to 0 0 smaller than 1 loop runs re is decremented re is now -1 -1 still smaller than 1 loop runs re is decremented re is now -2 -2 still smaller than 1 loop runs ... |