Raised This Month: $ Target: $400
 0% 

set task disable


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-09-2022 , 15:31   Re: set task disable
Reply With Quote #1

If you have multiple tasks in your plugin and want to remove them individually, you should assign them an unique id.

Code:
const YOUR_TASK_ID = 123800 const ANOTHER_TASK_ID = 123900

The numbers don't matter, but it's important that there's at least 32 numbers between them so they don't get mixed up with player slots. You will be combining these ids with a player id.

Code:
set_task(31.1, "removeweapons", id + YOUR_TASK_ID)

Then in task callback function:

Code:
public removeweapons(id) {     id -= YOUR_TASK_ID     // your code here... }
__________________

Last edited by OciXCrom; 01-09-2022 at 15:31.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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:41.


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