Raised This Month: $ Target: $400
 0% 

Solved set_task help


Post New Thread Reply   
 
Thread Tools Display Modes
Natsheh
Veteran Member
Join Date: Sep 2012
Old 12-29-2020 , 15:07   Re: set_task help
Reply With Quote #11

what the plugin suppose to do anyway??
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-29-2020 , 15:50   Re: set_task help
Reply With Quote #12

Quote:
Originally Posted by lexzor View Post
I said very clearly what I want to do in the first post.
I often ask for details of the actual goal because way too often people succumb to the XY Problem.
__________________
fysiks is offline
lexzor
Veteran Member
Join Date: Nov 2020
Old 12-29-2020 , 17:26   Re: set_task help
Reply With Quote #13

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 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-30-2020 , 04:02   Re: set_task help
Reply With Quote #14

Quote:
Originally Posted by lexzor View Post
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
Clearly you didn't read and/or comprehend the XY problem that I previously mentioned. Also, the stopplugin variable in your posted code didn't do anything so it seemed like you may have more problems than just set_task().

I'm just trying to help you get your plugin working. Don't take any offense to asking about your goal.
__________________

Last edited by fysiks; 12-30-2020 at 04:11.
fysiks is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 12-30-2020 , 11:05   Re: set_task help
Reply With Quote #15

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 View Post
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_existsRoundTaskID ) )
{
     
//Currently between round start and 25 seconds, CT's cannot rush

__________________

Last edited by Bugsy; 12-31-2020 at 11:16.
Bugsy is offline
lexzor
Veteran Member
Join Date: Nov 2020
Old 01-02-2021 , 04:04   Re: set_task help
Reply With Quote #16

Thank you bugsy. I know fysiks's trying to help us and ask for as much information as possible to give the best advice, but for those like me who don't know the language very well it's often quite difficult to start explaining some things that have no use in understanding the subject. thanks for all the tips, i will try to optimize the code and post it here creating a new topic.
lexzor is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:08.


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