If ||
#9

Quote:
Originally Posted by yvoms
Посмотреть сообщение
So if im correct if(pData[playerid][Copban] automaticly fetches the value?
You were checking for "not 0, != 0", so in this particular matter, we can do the following: "if(pData[playerid][Copban])" means not 0 and "if(!pData[playerid][Copban])" means 0. Just like with booleans "if(a)" means if "a" is true and "if(!a)" means if "a" is false.

What's 0 is false, what's not 0 is true.

And like I said, there's ABSOLUTELY no need for you to validate their class whatsoever if a player is not cop banned. Meaning, go with any of the following:
pawn Код:
if(pData[playerid][Copban])
{
    if(gTeam[playerid] == TEAM_COP || gTeam[playerid] == TEAM_CIA || gTeam[playerid] == TEAM_FBI)
    {

    }
}
pawn Код:
if((pData[playerid][Copban]) && (gTeam[playerid] == TEAM_COP || gTeam[playerid] == TEAM_CIA || gTeam[playerid] == TEAM_FBI))
{

}
Not that the inner parenthesis are separating each condition as it goes (just like in groups).

Example:
pawn Код:
if((2 == 2 || 3 == 4) && (5 == 5))
If the first condition in "(2 == 2 || 3 == 4)" is true, then the condition is completed; otherwise, it isn't.
Reply


Messages In This Thread
If || - by yvoms - 03.01.2016, 00:56
Re: If || - by Godey - 03.01.2016, 01:04
Re: If || - by AndySedeyn - 03.01.2016, 01:08
Re: If || - by SickAttack - 03.01.2016, 01:11
Re: If || - by Karan007 - 03.01.2016, 06:47
Re: If || - by yvoms - 03.01.2016, 12:20
Re: If || - by AbyssMorgan - 03.01.2016, 12:24
Re: If || - by yvoms - 03.01.2016, 17:40
Re: If || - by SickAttack - 03.01.2016, 23:34

Forum Jump:


Users browsing this thread: 1 Guest(s)