Bool Variable & Normal Variable
#4

@Adyzta i know that. but what's the difference about Normal on and bool one?

Quote:
Originally Posted by Rajat_Pawar
Посмотреть сообщение
Look in my signature for a tutorial on bools.
@Rajat_Pawar Looking at it now.

EDIT

just one question as i see on your tutorial. the godmode.

Mine

pawn Код:
new IsOnGodMode[MAX_PLAYERS];

CMD:godmode(playerid, params[])
{
    if(IsOnGodMode[playerid] == 1) //Checking if the 'state' of the player is GOD MODE.
        return SendClientMessage(playerid, -1,"You are already on god mode");
    if(IsOnGodMode[playerid] == 0) //Checking if the 'state' of the player is NOT GOD MODE.
        return SendClientMessage(playerid, -1,"You're god mode is already off!");
    return 1;
}
Yours
pawn Код:
new bool:isplayerongodmode = false;
CMD:god(playerid)
{
    if(isplayerongodmode == false) //Checking if the 'state' of the player is NOT GOD MODE.
{
 SetPlayerHealth(playerid, 999); //Setting the player's health to infinity.
 isplayerongodmode = true; //Setting the player's mode to 'ON GOD MODE'.
 }
 if(isplayerongodmode == true) //Checking if the 'state' of the player is GOD MODE.
{
 SendClientMessage(... "You are already on god mode!"); //Sending him the error message.
 }
return 1;
}
I can only see the difference is on bool uses true and normal one uses 1
Reply


Messages In This Thread
Bool Variable & Normal Variable - by Patrick - 10.03.2013, 11:01
Re: Bool Variable & Normal Variable - by InfiniTy. - 10.03.2013, 11:07
Re: Bool Variable & Normal Variable - by RajatPawar - 10.03.2013, 11:08
Re: Bool Variable & Normal Variable - by Patrick - 10.03.2013, 11:08
Re: Bool Variable & Normal Variable - by FunnyBear - 10.03.2013, 11:14
Re: Bool Variable & Normal Variable - by RajatPawar - 10.03.2013, 12:31
Re: Bool Variable & Normal Variable - by Patrick - 10.03.2013, 12:39
Re: Bool Variable & Normal Variable - by emokidx - 10.03.2013, 16:16

Forum Jump:


Users browsing this thread: 1 Guest(s)