Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnFilterScriptInit()
- {
- TCHECK();
- return 1;
- }
- forward TCHECK();
- public TCHECK()
- {
- new hour,minute,second,ctime,ftime,ztime,zstring[128];
- gettime(hour,minute,second);
- FixHour(hour);
- hour = shifthour;
- if(minute == 00) return PAYCHECK(); // if minute is 00 we call payday, else not
- SetWorldTime(hour);
- ctime = (minute - 59); // current time - 59 - by this we get time remaining till minute 59.
- ftime = (ctime * 60); // Calculating how many seconds ctime is in minutes //
- format(zstring, sizeof(zstring),"%d000",ftime); // formating the remaining time.
- strdel(zstring, 0,1); // deleting the minus from the number.
- ztime = strval(zstring); // Formating the string into an integer.
- SetTimer("PAYCHECK",ztime+60000,0); // we now set a timer with the seconds raiming till HOUR:00 and adding one minute!
- return 1;
- }
- forward PAYCHECK();
- public PAYCHECK()
- {
- new hour,minute,second;
- gettime(hour,minute,second);
- FixHour(hour);
- hour = shifthour;
- SetWorldTime(hour);
- SendClientMessageToAll(COLOR_YELLOW, "PayDay!");
- SendClientMessageToAll(COLOR_YELLOW, "Thanks for playing on Leans Training Server.");
- SetTimer("PAYCHECK",3600000,0); // We call this script in exactly 3600 seconds (ONE HOUR).
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment