Date Bug - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Date Bug (
/showthread.php?tid=86968)
Date Bug -
UsaBoy91 - 17.07.2009
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 ?
Re: Date Bug -
MenaceX^ - 17.07.2009
Add getdate.
Re: Date Bug -
UsaBoy91 - 17.07.2009
it's added , the compile work ...
pawn Код:
new day,month,year;
getdate(year,month,day);
Re: Date Bug -
MenaceX^ - 17.07.2009
print the date, if it prints everything ok your code is not good.
Re: Date Bug -
UsaBoy91 - 17.07.2009
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 ...
Re: Date Bug -
MenaceX^ - 17.07.2009
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 ... ![Shocked](images/smilies/surprised.gif)
|
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.
Re: Date Bug -
UsaBoy91 - 17.07.2009
so i can't do anything like this to work ?
Re: Date Bug -
MachineHead - 17.07.2009
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.
Re: Date Bug -
UsaBoy91 - 17.07.2009
No , no , no , you fail.
Because is || ( or ) not && ( and ) ...
== or =! in a if statment ,
Re: Date Bug -
MachineHead - 17.07.2009
Quote:
Originally Posted by MJφ
No , no , no , you fail.
Because is || ( or ) not && ( and ) ...
|
No really? WOW. Ignore my suggestion then.