AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Exact time with Task Scheduler (https://forums.alliedmods.net/showthread.php?t=319207)

MihailoZ 10-19-2019 09:32

Exact time with Task Scheduler
 
Hi,

I would like to know if it's possible to make a task that will run at 18:10:45 using this plugin https://forums.alliedmods.net/showthread.php?t=1263 ?

Bugsy 10-19-2019 11:22

Re: Exact time with Task Scheduler
 
Try:

amx_task "18:10:45" "command" tr

Edit: Looking at how that plugin is coded, I am doubtful, it is much less complicated than I was expecting.

JocAnis 10-19-2019 15:17

Re: Exact time with Task Scheduler
 
if it cant affect seconds (dont have time now to look at the code)...make it to 18:10 to call pre_your_func1 so

pre_your_func1 would have set_task of 45 sec for your_func1..no?

Bugsy 10-19-2019 15:39

Re: Exact time with Task Scheduler
 
That plugin works but has a few things wrong. With very few changes it can handle seconds. It was so simple to make possible, I'm not sure why the coder didn't do this to begin with. Literally as simple as changing get_time("%H:%M",curtime,charsmax(curtime)) to get_time("%H:%M:%S",curtime,charsmax(curtime) ) and expanding the string size that holds the time value to accommodate seconds and changing the set_task() interval to 1.0 second.

Tested and works with this (without the extra spaces in the time): amx_task "15 : 37 : 00" "changelevel de_dust" t

Spoiler


All times are GMT -4. The time now is 02:47.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.