Set And Remove Tasks
So if i set a task like so :
PHP Code:
PHP Code:
|
Re: Set And Remove Tasks
if you only got one task in you script there is no need to add 100 to the id
|
Re: Set And Remove Tasks
Well, I have about 6 or more tasks so I need to add the 100 to remove the task separately.
|
Re: Set And Remove Tasks
Adding a players id to the task id is only needed if you have more than 1 task that is called on a per-player basis.
If your tasks are called that call actions on all players (via a loop or w\e) then you can just define individual task id's for each task. |
Re: Set And Remove Tasks
You don't need to check if the task exist when you try to remove it.
|
Re: Set And Remove Tasks
I just need to know if what I used above is the correct way to remove the task because when I use it it crashes my game. My other tasks that I mentioned earlier have the same task id. (id) So if I remove_task(id) i'll remove my other tasks along with it.
|
Re: Set And Remove Tasks
Show your full code and I will tell you if it is correct.
I can tell you that the below code is incorrect because you are trying to use the variable "id" which does not exist. Only some situations require adding a player id to the task id so don't always assume it is needed. PHP Code:
|
Re: Set And Remove Tasks
Alright here's my code, but I only added the single task :
PHP Code:
|
Re: Set And Remove Tasks
In this case you are only calling the task once so as soon as LOL is called, the task will automatically be removed. The only time you need to remove a task when you set the task to repeat\loop.
In your code, you are trying to use the variable "id" that does not exist in the plugin_init() function. Below is an example on where you can pass a player id into set_task() to then be passed on to the called function. PHP Code:
|
Re: Set And Remove Tasks
That isnt the actual code im using currently. I wanted the task to be auto-set on every round. Here's the code again but more exact :
PHP Code:
|
| All times are GMT -4. The time now is 13:53. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.