How can I do that?
#4

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:
Код:
#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);
	    }
    }
Reply


Messages In This Thread
How can I do that? - by None1337 - 14.12.2017, 10:58
Re: How can I do that? - by Kaperstone - 14.12.2017, 11:10
Re: How can I do that? - by None1337 - 14.12.2017, 11:27
Re: How can I do that? - by MEW273 - 14.12.2017, 11:47
Re: How can I do that? - by None1337 - 14.12.2017, 13:45
Re: How can I do that? - by Konstantinos - 14.12.2017, 14:28

Forum Jump:


Users browsing this thread: 1 Guest(s)