Raised This Month: $ Target: $400
 0% 

set_task parameters


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 12-02-2011 , 09:25   set_task parameters
Reply With Quote #1

Is this the correct way of doing this? This is my first time using the parameters in set_task. Searched for help but none of them has help out. Correct my codes. Thanks in advance.

PHP Code:
#define TASK_ONE    574397

public function1(victimattacker)
{
    new 
args[1]
    
    
args[0] = attacker
    
    set_task
(10.0"function2"player+TASK_ONEargs1)
}

public 
function2(taskidargs[])
{
    static 
player
    player 
= (taskid TASK_ONE)
    
    new 
attacker args[0]

or this

PHP Code:
#define TASK_ONE    574397

public function1(victimattacker)
{
    new 
args[2]
    
    
args[0] = victim
    args
[1] = attacker
    
    set_task
(10.0"function2"TASK_ONEargs2)
}

public 
function2(args[])
{
    new 
victim args[0]
    new 
attacker args[1]

Most likely the 2nd one works but I want to use remove_task on ONLY ONE player.
Excalibur.007 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-03-2011 , 00:41   Re: set_task parameters
Reply With Quote #2

The first one but I think you need to swap the taskid and args[] in the function2 definition.
__________________
fysiks is offline
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 12-03-2011 , 03:26   Re: set_task parameters
Reply With Quote #3

Thanks, I'll try it out.
Excalibur.007 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-03-2011 , 09:07   Re: set_task parameters
Reply With Quote #4

Both ways are correct.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 12-03-2011 , 10:08   Re: set_task parameters
Reply With Quote #5

Quote:
Originally Posted by ConnorMcLeod View Post
Both ways are correct.
For the first one don't they have to be switched in the function head like fysiks said?
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-03-2011 , 12:23   Re: set_task parameters
Reply With Quote #6

Sure.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-03-2011 , 18:25   Re: set_task parameters
Reply With Quote #7

Quote:
Originally Posted by ConnorMcLeod View Post
Both ways are correct.
Yes but he want's player specific tasks so only the first one will work for that.
__________________
fysiks is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-03-2011 , 18:35   Re: set_task parameters
Reply With Quote #8

I hadn't see that he wants to be able to remove it, then you are right.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 12-03-2011 at 18:36.
ConnorMcLeod 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 08:28.


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