question about bools
#1

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?
Reply
#2

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

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.
Reply
#4

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.");
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)