Raised This Month: $ Target: $400
 0% 

Using stupid task thingy... :)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Cronck
Member
Join Date: Apr 2005
Old 04-30-2005 , 19:21   Using stupid task thingy... :)
Reply With Quote #1

Im trying to make task that calls my Heal_Progress function with (id, target) every 0.1 when using +heal...

Whats wrong with this code?
Code:
set_task(0.1,"Heal_Progress", 46475+id, id, target, 2, "a")

And please make sure this will work too
Code:
remove_task(46475+id)
__________________
No public plugins yet...
Cronck is offline
BioHazardousWaste
Senior Member
Join Date: Apr 2005
Location: Ontario, Canada =)
Old 04-30-2005 , 19:51  
Reply With Quote #2

I'm probably just stupid.. but i've never gottan an int to work with set_task, I always convert to a string, then back to an int. Maybe that will help. Otherwise, it's pretty hard to say seems how you don't give us an error, or a good description of the problem
__________________
"What then is truth? Truths are illusions which we have forgotten are illusions - they are metaphors that have become worn out... this (truth) is the duty to lie according to a fixed convention.

-Friedrich Nietzsche
BioHazardousWaste is offline
Send a message via MSN to BioHazardousWaste
Cronck
Member
Join Date: Apr 2005
Old 04-30-2005 , 20:01  
Reply With Quote #3

'id' and 'target' are stored in 2 vars...

How do i make a task that calls Heal_Progress(id, target) every 0.1 second until i remove the task?
__________________
No public plugins yet...
Cronck is offline
Ced
Member
Join Date: Oct 2004
Old 04-30-2005 , 20:08  
Reply With Quote #4

Code:
#define TASK_HEAL 100 new TaskId = TASK_HEAL + id; new parmHeal[2]; parmHeal[0] = id; parmHeal[1] = target; set_task( 0.1, "Heal", TaskId, parmHeal, 2, "b" );
and then u would do
Code:
remove_task( TASK_HEAL + id, 0);
Ced is offline
Cronck
Member
Join Date: Apr 2005
Old 04-30-2005 , 20:34  
Reply With Quote #5

Thanks
__________________
No public plugins yet...
Cronck is offline
Cronck
Member
Join Date: Apr 2005
Old 05-01-2005 , 08:09  
Reply With Quote #6

No matter what i do this code will make the function called crash... :S
Code:
        new TaskId = TASK_HEAL + id         new parmHeal[2]         parmHeal[0] = id         parmHeal[1] = targetid         set_task( 0.1, "Heal_Process", TaskId, parmHeal, 2, "b" )

Code:
public Heal_Process(id, target){     client_print(id,print_chat,"Target Id: %i",target)

Does the array change the number or something?
__________________
No public plugins yet...
Cronck is offline
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 05-01-2005 , 11:32  
Reply With Quote #7

You can't pass parameters into a set_task() function like that... you must do:

Code:
public Heal_Process( aCmdArgs[] ) {     new id = aCmdArgs[0]     new TargetID = aCmdArgs[1]     client_print( id ,print_chat, "Target Id: %i", TargetID ) }

Understand?
xeroblood is offline
Send a message via MSN to xeroblood
Cronck
Member
Join Date: Apr 2005
Old 05-01-2005 , 14:07  
Reply With Quote #8

Yes, i get the point... I just didn't think about that

Thanks!
__________________
No public plugins yet...
Cronck 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 12:02.


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