SA-MP Forums Archive
question about bools - 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: question about bools (/showthread.php?tid=428197)



question about bools - HurtLocker - 04.04.2013

If i define a bool and dont give to it a value, Whats its default value? true or false? I mean if i have a statement: if (test[playerid]==false) will it be triggered?


Re: question about bools - Babul - 04.04.2013

a bool is usually initialized with 0=false. everything starts at zero ^^
so yes, your condition will trigger.


Re: question about bools - HurtLocker - 04.04.2013

Thanks a lot. I asked that cause I have a gm which has a bool and i searched a lot in it to find where the definition of the bool is located and as you say it simple doesnt have to exist.


Re: question about bools - MP2 - 04.04.2013

Could you not test this yourself in ~10 seconds?

pawn Код:
public OnFilterScriptInit()
{
    new bool:test;
    if(test == false) print("Bools init as false.");
    else print("Bools init as true.");
}