SA-MP Forums Archive
[Question] How i fix this/ - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Question] How i fix this/ (/showthread.php?tid=99241)



[Question] How i fix this/ - borisblat - 26.09.2009

warning 206: redundant test: constant expression is non-zero
this happents on this line: if(tmp, OpenA, true)



Re: [Question] How i fix this/ - ilikepie2221 - 26.09.2009

Код:
redundant test: constant expression is non-zero

Where a conditional expression was expected, a constant expression
with a non-zero value was found, e.g. if (1). The test is
redundant, because the conditional code is always executed.
To create an endless loop, use for ( ;; ) instead of while (1).
Copied from the pawn-lang.pdf.

Meaning your if operator is useless, it will always be executed.


Re: [Question] How i fix this/ - borisblat - 26.09.2009

so , how i can fix this? xd


Re: [Question] How i fix this/ - MadeMan - 26.09.2009

What should that code do?


Re: [Question] How i fix this/ - borisblat - 26.09.2009

Well it's a chat actvity, there is a question, first one who answer correct, win.

tmp = strtok(cmdtext, idx);
OpenPA[playerid] = strval(tmp);
SCM(playerid, GREEN, "You have send your answer.");
if(tmp, OpenA, true)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if( i != playerid)
{
if(OpenPA[i], OpenA, true)
{
OpenPA[playerid] = 999;
}
else OpenPA[i] = 999;
}
}
}
}