SA-MP Forums Archive
warning 215: expression has no effect - 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)
+--- Thread: warning 215: expression has no effect (/showthread.php?tid=570499)



warning 215: expression has no effect - davidbull - 10.04.2015

Код:
((i+1) % 2) ? strcat(dstr, "{00f0f0}") : strcat(dstr, "{f0f000}");//alternating color to rows in dialog
C:\Users\userz\Desktop\Web Map loader_unloader Source\pawn\map.pwn(156) : warning 215: expression has no effect
C:\Users\userz\Desktop\Web Map loader_unloader Source\pawn\map.pwn(192) : warning 215: expression has no effect
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Warnings.


Re: warning 215: expression has no effect - davidbull - 10.04.2015

anyone? i'll rep+


Re: warning 215: expression has no effect - Vince - 10.04.2015

The ternary operator can't be used standalone like that. Either use normal if-else or use it like this:
pawn Код:
strcat(dstr, (i % 2) ? ("{f0f000}") : ("{00f0f0}"));
Extra brackets are necessary due to a bug in the compiler (blame ******).


Re: warning 215: expression has no effect - davidbull - 10.04.2015

thanks