SA-MP Forums Archive
how to save date in variable and check getdate(year, month, day); if(varible < day) - 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: how to save date in variable and check getdate(year, month, day); if(varible < day) (/showthread.php?tid=243440)



how to save date in variable and check getdate(year, month, day); if(varible < day) - jame42 - 23.03.2011

how to save date in variable and check getdate(year, month, day); if(varible < day)
sorry for my english


Re: how to save date in variable and check getdate(year, month, day); if(varible < day) - pawn_ - 23.03.2011

Try the code below, and edit it to your likings.

pawn Код:
new date[4];

// Put this snippet where you want it.
new year, month, day;
getdate(year, month, day);
date[0] = year;
date[1] = month;
date[2] = day;

stock PayDay() // For example.
{
    new year, month, day;
    getdate(year, month, day);
    if(date[2] < day) // If the day set in 'GetDate' is lower than the current day, let's say date[2] was 26, and 'day' was 30.
    {
        // Code here.
    }
    return 1;
}