I consider it to be a good idea to always give a random number as a task id, if you plan on manually ending it at some time.
For instance, in my plugins I do something like this:
Code:
#define TASKID_THISACTION 84278346
And then later:
Code:
// if i don't need to know the player's id that set off this task...
set_task(timeLength, "myFunction", TASKID_THISACTION);
// or if I do need to know the player's id...
set_task(timeLength, "myFunction", TASKID_THISACTION + id);
Finally, I might end the task like:
Code:
// ending the first example of the task I gave...
remove_task(TASKID_THISACTION);
I'll leave what I would do in
myFunction as an exercise for the reader.
Instead of trying to come up with your own pseduo-random number, I suggest using a site like
this that will do it for you.