Date Bug
#1

I was testing something , and i found a bug. I'm trying to use this in a timer , but this don't work ...
pawn Код:
if((month != 1 && day != 31) && (month != 2 && day != 28) && (month != 3 && day != 31) &&
                    (month != 4 && day != 30) && (month != 5 && day != 31) && (month != 6 && day != 30) &&
                    (month != 7 && day != 31) && (month != 8 && day != 31) && (month != 9 && day != 30) &&
                    (month != 10 && day != 31) && (month != 11 && day != 30) && (month != 12 && day != 31))
                    {
                        SendClientMessage(i,COLOR_LIGHTBLUE,"You recive 1$ because today it's not the finish of a month."); GivePlayerMoney(i,1);
                    }
My date it's set on 17 July and i don't recive this message , why ?
Reply
#2

Add getdate.
Reply
#3

it's added , the compile work ...

pawn Код:
new day,month,year;
                getdate(year,month,day);
Reply
#4

print the date, if it prints everything ok your code is not good.
Reply
#5

lol this must work ...

How it proceed :

If today we are not in Ianuary 31 & Februarie 28 & March 31 & Aprill 30 & May 31 & Juny 30 & July 31 & August 31 & September 30 & Octomber 31 & November 30 & December 31 , give me a $ and send me that message ...
Reply
#6

Quote:
Originally Posted by MJφ
lol this must work ...

How it proceed :

If today we are not in Ianuary 31 & Februarie 28 & March 31 & Aprill 30 & May 31 & Juny 30 & July 31 & August 31 & September 30 & Octomber 31 & November 30 & December 31 , give me a $ and send me that message ...
Yeah. I was about to post it.
You can't change the date, you can only via the gamemode. But you won't get anything unless today is the day players need to get the money.
Reply
#7

so i can't do anything like this to work ?
Reply
#8

I see it as..

pawn Код:
if((month == 1 && day != 31) || (month == 2 && day != 28) || (month == 3 && day != 31) ||
(month == 4 && day != 30) || (month == 5 && day != 31) || (month == 6 && day != 30) ||
(month == 7 && day != 31) || (month == 8 && day != 31) || (month == 9 && day != 30) ||
(month == 10 && day != 31) || (month == 11 && day != 30) || (month == 12 && day != 31))
{
SendClientMessage(i,COLOR_LIGHTBLUE,"You recive 1$ because today it's not the finish of a month."); GivePlayerMoney(i,1);
}
Just a theory...

Is it == or just = I forget.
Reply
#9

No , no , no , you fail.

Because is || ( or ) not && ( and ) ...

== or =! in a if statment ,
Reply
#10

Quote:
Originally Posted by MJφ
No , no , no , you fail.

Because is || ( or ) not && ( and ) ...
No really? WOW. Ignore my suggestion then.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)