Raised This Month: $ Target: $400
 0% 

Task ID


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 04-30-2010 , 16:55   Task ID
Reply With Quote #1

I just found this from a plugin which I used:

PHP Code:
#define TASKID            1337    // change if it interfere with another plugin! 
And another plugin which I use, uses also define TASKID. My question is now, what is TASKID exactly, what does it do, and should I really change the number in the other plugin, if yes to which number?
KadiR is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 04-30-2010 , 17:02   Re: Task ID
Reply With Quote #2

It's the ID of a task.

It's used if you wanted to use remove_task, task_exists, or change_task.
It's passed as the third parameter of set_task and can easily be changed as long as it's defined.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 04-30-2010 , 17:06   Re: Task ID
Reply With Quote #3

Quote:
Originally Posted by wrecked_ View Post
It's the ID of a task.

It's used if you wanted to use remove_task, task_exists, or change_task.
It's passed as the third parameter of set_task and can easily be changed as long as it's defined.
Thanks for your information. Do I need to change the number in the other plugin, if yes to which number?
KadiR is offline
HLM
Senior Member
Join Date: Apr 2008
Location: C:\WINDOWS\System32
Old 04-30-2010 , 17:11   Re: Task ID
Reply With Quote #4

you will only ever need to change it if you notice the number in the two plugins are the same, if not you can leave it as it is.
__________________
+|- KARMA Respectively

HLM is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 04-30-2010 , 18:18   Re: Task ID
Reply With Quote #5

so if i understand it, when you have 2 seperate plugins, it is possible to remove a task from plugin 1 using plugin 2


plugin1
PHP Code:
#define TASKID 1337

set_task(1.0"something"TASKID
plugin2
PHP Code:
if(task_exists(1337))
    
remove_task(1337
Is this possible?
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-30-2010 , 18:29   Re: Task ID
Reply With Quote #6

The same task id's in more than one plugin only matters if you are using remove_task(), task_exists(), or change_task() to access other plugins.

To use those inside your own plugin, you don't need to set the "outside" argument.
If you want to access tasks in other plugins, set the "outside" argument to 1.

http://www.amxmodx.org/funcwiki.php?...task&go=search
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 04-30-2010 , 18:36   Re: Task ID
Reply With Quote #7

thanks exolent
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 04-30-2010 , 18:46   Re: Task ID
Reply With Quote #8

Quote:
Originally Posted by KadiR View Post
Thanks for your information. Do I need to change the number in the other plugin, if yes to which number?
The numbers don't matter when setting a task, as long as they are the same each time you call the task or use a function for it.

All you'd have to do is make sure the TASKID define is used all over instead of changing task id's each time. The number you set doesn't matter, just make sure it's original. I use 1996's for each of them.

Just make sure you have an interval of atleast 32 between each taskid, since it often happens where people will use
Code:
#define TASKID 1996 //#define OTHER_TASKID 2996 public somefunc(id) {     set_task( 1.0, "func", id + TASKID ) } public func( TASK ) {     new id = TASK - TASKID     // ... }
and it could cause confusion / malfunctioning.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 04-30-2010 , 18:58   Re: Task ID
Reply With Quote #9

i don't get the

id + taskid
and
new id = TASK - TASKID

could you explain that?
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-30-2010 , 18:58   Re: Task ID
Reply With Quote #10

It's useful when you want multiple tasks that depend on a player's id.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 19:10.


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