[Include] time-operators.inc - 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: Filterscripts (
https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (
https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] time-operators.inc (
/showthread.php?tid=640660)
time-operators.inc -
OneDay - 05.09.2017
PHP код:
#if defined _INC_time_operators
#endinput
#endif
#define _INC_time_operators
#define MAKE_TIME(%1) _:SEE_CO:SEE_BR:SEE_SC:%1+
#define SEE_CO:SEE_BR:SEE_SC:%1+, %1,
#define SEE_BR:SEE_SC:%1+) %1)
#define SEE_SC:%1+; %1;
#define _Day * MAKE_TIME(86400000)
#define _Days * MAKE_TIME(86400000)
#define _Hour * MAKE_TIME(3600000)
#define _Hours * MAKE_TIME(3600000)
#define _Minute * MAKE_TIME(60000)
#define _Minutes * MAKE_TIME(60000)
#define _Second * MAKE_TIME(1000)
#define _Seconds * MAKE_TIME(1000)
#define _Millisecond
#define _Milliseconds
// Examples:
// SetTimer("TimerFunc", 1 _Day 3 _Hours 7 _Seconds, false);
// SetTimer("TimerFunc", 5_Minutes, false);
// SetTimer("TimerFunc", 1_Minutes, false);
// SetTimer("TimerFunc", 1_Hour 1_Minute, false);
// SetTimer("TimerFunc", 1 _Minute, false);
// SetTimer("TimerFunc", 500_Milliseconds, false);
Examples:
PHP код:
#include <time-operators>
SetTimer("TimerFunc", 1 _Day 3 _Hours 7 _Seconds, false);
SetTimer("TimerFunc", 5_Minutes, false);
SetTimer("TimerFunc", 1_Minutes, false);
SetTimer("TimerFunc", 1_Hour 1_Minute, false);
SetTimer("TimerFunc", 1 _Minute, false);
SetTimer("TimerFunc", 500_Milliseconds, false);
Re: time-operators.inc -
Eoussama - 05.09.2017
Wow, that's actually clever, +REP.