Pawn -> And/or
#7

pawn Код:
forward refreshTimer();
public refreshTimer()
{
    if(minute <= 9 &&|| second <= 9) { printf("The time is %d:0%d:0%d %s", hour, minute, second, timemode); }
    else { printf("The time is %d:%d:%d %s.", hour, minute, second, timemode); }
}
The one above wouldn't work, but it still proves that using and/or isn't worthless.

But I'm guessing it could also work like this:

pawn Код:
forward refreshTimer();
public refreshTimer()
{
    if(minute <= 9 && second <= 9) { printf("The time is %d:0%d:0%d %s", hour, minute, second, timemode); }
    else if(minute <= 9) { printf("The time is %d:0%d:%d %s.", hour, minute, second, timemode); }
    else if(second <= 9) { printf("The time is %d:%d:0%d %s.", hour, minute, second, timemode); }
    else { printf("The time is %d:%d:%d %s.", hour, minute, second, timemode); }
}
--

Quote:
Originally Posted by nemesis_567
Посмотреть сообщение
&& is for and
|| is for or
pawn Код:
If(GetPlayerMoney(playerid) > 50 && GetPlayerMoney(playerid) < 100) SendClientMessage(playerid, FFFFFF, "You have more than $50 but less than $100.");
If(GetPlayerMoney(playerid) <50 || GetPlayerMoney(playerid) > 100) SendClientMessage(playerid, FFFFFF, "You either have less than $50 or more than $100.");
Trying to create an 'and' and 'or' at the same time will never return anything.
That code wouldn't work, as the if statement doesn't have an uppercase letter, also, the color code you have is not hexidemical, white is 0xFFFFFFFF.
Reply


Messages In This Thread
Pawn -> And/or - by SchurmanCQC - 17.04.2011, 20:23
Re: Pawn -> And/or - by nemesis_567 - 17.04.2011, 20:26
Re: Pawn -> And/or - by DeathOnaStick - 17.04.2011, 20:26
Re: Pawn -> And/or - by nemesis_567 - 17.04.2011, 20:28
Re: Pawn -> And/or - by DeathOnaStick - 17.04.2011, 20:29
Re: Pawn -> And/or - by nemesis_567 - 17.04.2011, 20:30
Re: Pawn -> And/or - by SchurmanCQC - 17.04.2011, 23:35
Re: Pawn -> And/or - by Vince - 17.04.2011, 23:40

Forum Jump:


Users browsing this thread: 1 Guest(s)