Thread: [Solved] hook to specific timestamp
View Single Post
Watermelonnable
Member
Join Date: Feb 2017
Old 12-04-2019 , 15:59   Re: hook to specific timestamp
Reply With Quote #6

Quote:
Originally Posted by OciXCrom View Post
The "set_task" function has a flag that allows it to count the time until the end of the map:



So, instead of using maths, you can do:

Code:
set_task(300.0, "Hook5MinutesRemaining", .flags = "d")
Thank you. I will try this and let you know the results.

For the meantime I did some debugging and came across that
PHP Code:
get_timeleft() 
and also

PHP Code:
 get_pcvar_num(get_cvar_pointer("mp_timelimit")) 
returns 0 if I try to assign those values inside plugin_init. Can you please tell me why?

EDIT: Your solution worked like a charm Thank you again

Last edited by Watermelonnable; 12-04-2019 at 16:05.
Watermelonnable is offline