Raised This Month: $32 Target: $400
 8% 

Problem with task


Post New Thread Reply   
 
Thread Tools Display Modes
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 05-01-2020 , 09:57   Re: Problem with task
Reply With Quote #11

Exactly what safetymoose said. Avoiding overlaps.
Max players is 32, max entities is 10000.
So in order to avoid removing the wrong tasks, every task that follows the initially defined one has to have an ID of max players/entities + 1.
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-01-2020 , 10:35   Re: Problem with task
Reply With Quote #12

Lol, I understand that, I think you are missing the point I am making. Mind you, yes this will technically work, but the fact that your enum entries have such large increments for each makes no sense to me. Why not do only a plus 1 for each? Did you read the commends I added after g_iIDTaskCheckConnected and g_iIDTaskSoundPlayDelay above?

IMO, it should be this:
Code:
g_iIDTaskBurn = 33
g_iIDTaskCheckConnected = 34   //Add 1, this makes it unique.

g_iIDTaskSoundRepeat = 10000
g_iIDTaskSoundPlayDelay = 10001   //Add 1, this makes it unique.
g_iIDTaskSpriteRepeat = 10002
g_iIDTaskDisableFireNadeZP = 10003
g_iIDTaskFireDamageCoolDown= 10004
g_iIDTaskExposureTimeDecrease = 10005
g_iIDTaskAd= 10006
Instead of what you have:
Code:
g_iIDTaskBurn = 32
g_iIDTaskCheckConnected = 65    //Why jump from 32 to 65?

g_iIDTaskSoundRepeat = 10000
g_iIDTaskSoundPlayDelay = 20001    //Why jump from 10000 to 20001?
g_iIDTaskSpriteRepeat = 30002
g_iIDTaskDisableFireNadeZP = 40003
g_iIDTaskFireDamageCoolDown= 50004
g_iIDTaskExposureTimeDecrease = 60005
g_iIDTaskAd= 70006
__________________

Last edited by Bugsy; 05-01-2020 at 10:37.
Bugsy is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 05-01-2020 , 10:48   Re: Problem with task
Reply With Quote #13

Yup I read them.
It's because if you do
PHP Code:
remove_task(iIDPlayer g_iIDTaskBurn
where iIDPlayer is 2 for example it will be 2 + 33 = 35, which will also remove g_iIDTaskCheckConnected when iIDPlayer is 1 since 1 + 34 is also 35.
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-01-2020 , 15:19   Re: Problem with task
Reply With Quote #14

Ah, ok, agreed, I wasn't taking that into consideration.
__________________
Bugsy is offline
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 08-07-2020 , 21:13   Re: Problem with task
Reply With Quote #15

Sorry for reviving but it does not work, it still does not remove the task I put it like this:

PHP Code:
#define TASK_GIVEDEAGLE 500
#define TASK_REMOVEDEAGLE 800 
wicho is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-07-2020 , 22:12   Re: Problem with task
Reply With Quote #16

remove_task() works. I would start with doing a server_print()/client_print() of the task ID value both when you create the task and attempt to remove it. The native definitely works so it is something in your code. Are there possibly other plugins running that are giving you false results?
__________________
Bugsy 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 11:02.


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