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.