SA-MP Forums Archive
Boolean limitations - 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: Boolean limitations (/showthread.php?tid=655781)



Boolean limitations - Akeem - 29.06.2018

Can i use 0 insteady of false in a boolean?


Re: Boolean limitations - Lokii - 29.06.2018

No, whats the problem with true and false i know 0 and 1 is less typing but not by much.


Re: Boolean limitations - Akeem - 29.06.2018

Is it adviced to call if(ploggined == false).
Because i use it like this if(ploggined == 0).


Re: Boolean limitations - Lokii - 29.06.2018

Quote:
Originally Posted by Akeem
Посмотреть сообщение
Is it adviced to call if(ploggined == false).
Because i use it like this if(ploggined == 0).
You can do this for both bool and int and its also less typing:

PHP код:
if(!ploggined//is like ploggined == false and for int like ploggined == 0
if(ploggined//is like ploggined != false and for int like ploggined != 0