fysiks, I think he understands/comprehends the XY problem as his response was that he did not feel it was necessary, and I partially agree as it looks like a pretty simple plugin. While I don't think it would hurt to provide a few sentences to outline what he is doing, it can be overkill in some cases. Looking at his original post, you can determine that he wants a variable set to false at round start and then set to true after 25 seconds; his issue stemmed from an existing task running and he was creating a new one over it resulting in inconsistent/unpredictable behavior.
Quote:
Originally Posted by lexzor
stopplugin is a variable that i use in if() to check if plugin is disabled or not.
i was thinking that it was unnecessarily to give more informations about the whole plugin if my problem was with set_task.
thanks for you help
|
lexzor, to add on to this
post, you could remove the stopplugin variable and use task_exists() in its place. Though, using a variable to do this is completely fine. I would avoid using random values anywhere in your code, like you have above with '1024'. Create a constant variable to hold this value so those looking at your code know what the value means.
PHP Code:
if ( task_exists( RoundTaskID ) )
{
//Currently between round start and 25 seconds, CT's cannot rush
}
__________________