SA-MP Forums Archive
must be lvalue (non-constant) - 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: must be lvalue (non-constant) (/showthread.php?tid=430256)



must be lvalue (non-constant) - dusk - 13.04.2013

All errors:
pawn Код:
GangWars.pwn(178) : error 022: must be lvalue (non-constant)
GangWars.pwn(178) : warning 215: expression has no effect
GangWars.pwn(178) : error 001: expected token: ";", but found ")"
GangWars.pwn(178) : error 029: invalid expression, assumed zero
GangWars.pwn(178) : fatal error 107: too many error messages on one line
The line:
pawn Код:
if((pos[0] <= ZoneInfo[i][zMaxX] = && pos[0] >= ZoneInfo[i][zMinX]) && (pos[1] <= ZoneInfo[i][zMaxY] && pos[1] >= ZoneInfo[i][zMinY])) return 1;



Re: must be lvalue (non-constant) - Avi Raj - 13.04.2013

use this :-
pawn Код:
if((pos[0] <= ZoneInfo[i][zMaxX] = && pos[0] >= ZoneInfo[i][zMinX]) && (pos[1] <= ZoneInfo[i][zMaxY] && pos[1] >= ZoneInfo[i][zMinY]))) return 1;



Re: must be lvalue (non-constant) - dusk - 13.04.2013

nop
pawn Код:
GangWars.pwn(178) : error 022: must be lvalue (non-constant)
GangWars.pwn(178) : warning 215: expression has no effect
GangWars.pwn(178) : error 001: expected token: ";", but found ")"
GangWars.pwn(178) : error 029: invalid expression, assumed zero
GangWars.pwn(178) : fatal error 107: too many error messages on one line



Re: must be lvalue (non-constant) - [XST]O_x - 13.04.2013

pawn Код:
pos[0] <= ZoneInfo[i][zMaxX] = && pos[0]
?
= &&?
Extra '=' there.
pawn Код:
if((pos[0] <= ZoneInfo[i][zMaxX]  && pos[0] >= ZoneInfo[i][zMinX]) && (pos[1] <= ZoneInfo[i][zMaxY] && pos[1] >= ZoneInfo[i][zMinY]))) return 1;



Re: must be lvalue (non-constant) - Vince - 13.04.2013

Isn't it very obvious that you have a stray assignment operator (=) in your code? You don't have to be a genius to see that. Either way, the shorthand version:

pawn Код:
if((ZoneInfo[i][zMinX] <= pos[0] <= ZoneInfo[i][zMaxX]) && (ZoneInfo[i][zMinY] <= pos[1] <= ZoneInfo[i][zMaxY])) return 1;



Re: must be lvalue (non-constant) - dusk - 13.04.2013

Thank you.. and sorry with wasting you're time. I don't know how did i not see it, and thanks for the shortened version!