set_task help
hello. I have this code
PHP Code:
after a few rounds, there are more task at different times. i want this task to disable plugin after first 25 seconds, but with more tasks working, sometimes plugin is disabled after a random num of seconds. |
Re: set_task help
You're creating an infinitely repeating task (flag "b") every time the HLTV event occurs. So, you are creating several simultaneous tasks that never stop. So, after 5 HLTV events, you have 5 tasks that will all keep run until the map changes.
You should probably describe what you are actually trying to do so that we can give you the proper advice. Your "stopplugin" variable doesn't do anything. To run a task only once, don't use any flags. |
Re: set_task help
^
And using the HLTV event is not the proper way of catching roundstart, read this for more info: https://forums.alliedmods.net/showthread.php?t=42159 |
Re: set_task help
that is how i hook roundstart now
PHP Code:
PHP Code:
PHP Code:
and i have another ask. can i use set_task like this PHP Code:
|
Re: set_task help
This is not complicated
PHP Code:
|
Re: set_task help
Thank you guys, but my server is running a csgo mode and i have warmup round, so that's why in first round my tasks are more than normal
how can i do something like.. if an task is starting, to stop previously task ? |
Re: set_task help
See above
|
Re: set_task help
omg i didn t read all lines, thank you
|
Re: set_task help
is this ok ?
PHP Code:
|
Re: set_task help
You do not need to first call task_exists() before calling remove_task(), just do what I posted. task_exists() should only be used if you want to know if the task exists for other reasons/conditions.
|
| All times are GMT -4. The time now is 14:07. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.