SA-MP Forums Archive
Unix Timestamp? - 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)
+--- Thread: Unix Timestamp? (/showthread.php?tid=299657)



Unix Timestamp? - NRJ53 - 26.11.2011

Hello,

Is there a way of making this work?
pawn Code:
#define         mktimestamp(%0, %1, %2, %3, %4, %5, %6) \
                    (%0 + (60 * %1) + (60 * 60 * %2) + (60 * 60 * 24 * %3) + (60 * 60 * 24 * 7 * %4) + (60 * 60 * 24 * 30 * %5) + (60 * 60 * 24 * 365 * %6))
I converted from:
pawn Code:
stock makethetimehappen(zero, one, two, three, four, five, six) {
    new returnnumber = (zero + (60 * one) + (60 * 60 * two) + (60 * 60 * 24 * three) + (60 * 60 * 24 * 7 * four) + (60 * 60 * 24 * 30 * five) + (60 * 60 * 24 * 365 * six));
    return returnnumber;
}
Its for bans etc.


Re: Unix Timestamp? - Max_Coldheart - 27.11.2011

If you want to add unix timestamps, you should take a look at the Tutorial by ___ which covers everything.


Re: Unix Timestamp? - NRJ53 - 27.11.2011

I have, but this is to add time to an unix timestamp. This works:
pawn Code:
stock makethetimehappen(zero, one, two, three, four, five, six) {
    new returnnumber = (zero + (60 * one) + (60 * 60 * two) + (60 * 60 * 24 * three) + (60 * 60 * 24 * 7 * four) + (60 * 60 * 24 * 30 * five) + (60 * 60 * 24 * 365 * six));
    return returnnumber;
}
This doesn't:
pawn Code:
#define         mktimestamp(%0, %1, %2, %3, %4, %5, %6) \
                    (%0 + (60 * %1) + (60 * 60 * %2) + (60 * 60 * 24 * %3) + (60 * 60 * 24 * 7 * %4)