Raised This Month: $ Target: $400
 0% 

[HELP] set_task And remove_task


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
1liornatan
Member
Join Date: Sep 2010
Old 10-03-2011 , 17:18   [HELP] set_task And remove_task
Reply With Quote #1

Hey all
So my question is how i can use a taskid with an id
i search the answer but i still dont get it
should i do :
#define task_id 555

and then
set_task(10.0, "example", task_id + id)

and on a public example:
public example(id)

or what?
please help thanks all and sorry for bad english
1liornatan is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-03-2011 , 20:03   Re: [HELP] set_task And remove_task
Reply With Quote #2

In example(id), do id -= task_id, leaving you with the id value added to task_id in set_task..its simple math.

new task_id = 555
new id = 10
id + task_id = 565
565 - 555 = 10

Be sure to check if id is still connected before doing anything in the called function, or call remove_task(id+task_id) in client_disconnect().
__________________

Last edited by Bugsy; 10-03-2011 at 20:11.
Bugsy is online now
1liornatan
Member
Join Date: Sep 2010
Old 10-04-2011 , 01:30   Re: [HELP] set_task And remove_task
Reply With Quote #3

I still dont get it...
should public Example need to be:
public Example(id)
{
//
}

and can you post me a script that may help please?

[EDIT]:
that what i got:
i making a Example(id)
then id -= task_id
like this:
public example(id)
{
id -= task_id
// continue plugin
}

and using remove_task(id+task_id) where i want it to stop?
if i do how i use it on a value that change his number
like in countdown?

Last edited by 1liornatan; 10-04-2011 at 01:58.
1liornatan is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 10-04-2011 , 01:58   Re: [HELP] set_task And remove_task
Reply With Quote #4

This is how i do mine.
PHP Code:
cosnt TASK_BLEED 12345;

public 
OnPlayerHurt(iVictimiInflictoriAttackerFloat:flDamageiDmgBits)
{
     if(
flDamage >= 60.0)
     {
           
set_task(0.01"Bleed"id+TASK_BLEED);
      }
}

public 
Bleed(Task_Id)
{
     new 
id Task_Id -TASK_BLEED;
     
//Do stuf.

Doc-Holiday is offline
1liornatan
Member
Join Date: Sep 2010
Old 10-04-2011 , 08:25   Re: [HELP] set_task And remove_task
Reply With Quote #5

PHP Code:
#define TASK_NUM 555
 
public round_start(id)
{
    
remove_task(id+TASK_NUM)
}
 
public 
player_spawn(id)
{
    
set_task(10.0"example"id+TASK_NUM)
}
 
public 
example(id)
{
    new 
client id -= TASK_NUM
    
// and continue the funcion using client

Does its true?
and how do i use it on a value that changes his number like in count down?
thank you for help
1liornatan 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:41.


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