14.12.2017, 11:47
The above is one method, however, I believe it would be quite inefficient with all the if statements.
How I would do it is by checking if your loop 'i' is odd, and using that condition to set the color, see below:
How I would do it is by checking if your loop 'i' is odd, and using that condition to set the color, see below:
Код:
#define IsOdd(%0) %0 % 2 //checks if a number is odd
for(new i; i < MAX_REPORTS; ++i)
{
if(Reports[i][reportValide])
{
format(string, sizeof(string), "Report: %s", Reports[i][reportDetails]);
if(IsOdd(i)) SCM(playerid, COLOR_YELLOW, string);
else SCM(playerid, COLOR_BLUE, string);
}
}

