SA-MP Forums Archive
Help with error 029: invalid expression, - 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: Help with error 029: invalid expression, (/showthread.php?tid=661465)



Help with error 029: invalid expression, - Narkomann - 05.12.2018

I get this ...
C:\Users\Tomi\Desktop\Real Gaming v4.0 by Nelson\gamemodes\RG-RP.pwn(7762 : error 029: invalid expression, assumed zero
C:\Users\Tomi\Desktop\Real Gaming v4.0 by Nelson\gamemodes\RG-RP.pwn(7762 : error 029: invalid expression, assumed zero

For this line if(PlayerInfo[ playerid ][ xHelper ] >= 1 ) || (PlayerInfo[ playerid ][ xAdmin ] >= 1 ) || ( PlayerInfo[ playerid ][ xVIPLevel ] >= 1 ) || ( PlayerInfo[ playerid ][ xPromoter ] == 1 ) {
idk where is problem.


Re: Help with error 029: invalid expression, - Calisthenics - 05.12.2018

The problem is the parenthesis.
Код:
if(PlayerInfo[ playerid ][ xHelper ] >= 1 ) || (PlayerInfo[ playerid ][ xAdmin ] >= 1 ) || ( PlayerInfo[ playerid ][ xVIPLevel ] >= 1 ) || ( PlayerInfo[ playerid ][ xPromoter ] == 1 )
To fix it you will need to open one or remove the closed parentheses.
Код:
if((PlayerInfo[ playerid ][ xHelper ] >= 1 ) || (PlayerInfo[ playerid ][ xAdmin ] >= 1 ) || ( PlayerInfo[ playerid ][ xVIPLevel ] >= 1 ) || ( PlayerInfo[ playerid ][ xPromoter ] == 1 )
The same happens with the last expression
Код:
if(... || ( PlayerInfo[ playerid ][ xPromoter ] == 1 )
To fix it you will need to do the same as before.
Код:
if(... || ( PlayerInfo[ playerid ][ xPromoter ] == 1 ))
Or just use parenthesis when they are really required.
pawn Код:
if (PlayerInfo[ playerid ][ xHelper ] >= 1
|| PlayerInfo[ playerid ][ xAdmin ] >= 1  
|| PlayerInfo[ playerid ][ xVIPLevel ] >= 1
|| PlayerInfo[ playerid ][ xPromoter ] == 1)