SA-MP Forums Archive
[Include] US_Timers include - 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] US_Timers include (/showthread.php?tid=586963)



US_Timers include - UltraScripter - 26.08.2015

US_Timers include what it does? well it lets you set your own time and countdown you can like this 00:15 seconds
01:00:15 and 01:01:01:01 it gets seconds minutes hours and days!

Usage:
pawn Код:
TYPES =  SEC, MIN, HOUR, DAY //Sec is seconds Min is minutes HOUR is hours DAY is days
US_SetTimer(playerid, type); //setting timer to count 1 2 3....
US_ResetTimer(playerid); //setting all timers to 0
US_SetCountDown(playerid, type);  //count down 3 2 1. ...
US_GetSecs(playerid); //Getting Player seconds
US_GetMins(playerid); //Getting Player minutes
US_GetHours(playerid); //Getting Player hours
US_GetDays(playerid); //Getting Player days.
US_SetTimerTime(playerid, days, hours, minutes, seconds); //Sets time to exacly value you chose
US_SetTimerAdd(playerid, days, hours, minutes, seconds); //Adding time you want example 5 sec after this commands it will become 35 and keep 36, 37...
Links:
Solidfiles: http://www.solidfiles.com/d/f8c3ec930b/
Pastebin: http://pastebin.com/NVwm0N08
.


Re: US_Timers include - YoussefHammad - 26.08.2015

i'll use it for my server +rep


Re: US_Timers include - UltraScripter - 26.08.2015

Thx man


Re: US_Timers include - Crayder - 26.08.2015

It would be a lot healthier to just set the player's variables to the time (in unix) at the moment you run the SetTimer function. Then in the Get* functions you just subtract and modulate the difference.


Re: US_Timers include - UltraScripter - 26.08.2015

I know that I made it to use once everytime. for example /attack timer when it ends u can create again timer for something else.


Re: US_Timers include - Crayder - 26.08.2015

Quote:
Originally Posted by UltraScripter
Посмотреть сообщение
I know that I made it to use once everytime. for example /attack timer when it ends u can create again timer for something else.
You could do the same thing the way I said... I could give send you an example script if you don't understand.