SA-MP Forums Archive
Invalid expression assumed zero - 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: Invalid expression assumed zero (/showthread.php?tid=573355)



Invalid expression assumed zero - Blackazur - 06.05.2015

Hello, i want to make that you can use it if you are either VIP or Admin Level. So that you can already use if you are VIP or Admin. But it shows a error, how to fix it?

Код:
	if(pInfo[playerid][pVipLevel] >= 1 & if(pInfo[playerid][pAdminLevel] >= 1)



AW: Invalid expression assumed zero - Kaliber - 06.05.2015

Just write:

Код:
if(pInfo[playerid][pVipLevel] >= 1 || pInfo[playerid][pAdminLevel] >= 1)
Greekz


Re: Invalid expression assumed zero - Vince - 06.05.2015

Re-read, character by character. Then notice your typo: using the bitwise and instead of the logical and operator.


AW: Invalid expression assumed zero - Blackazur - 06.05.2015

Quote:
Originally Posted by Kaliber
Посмотреть сообщение
Just write:

Код:
if(pInfo[playerid][pVipLevel] >= 1 || pInfo[playerid][pAdminLevel] >= 1)
Greekz
Then you can use it if you are either VIP or Admin? You dont have to be both of them, right?


Re: Invalid expression assumed zero - Luis- - 06.05.2015

Yeah.

|| means if you're a VIP or an admin, you can use the function.
&& means you need to be a VIP and an admin to use the function.