Raised This Month: $ Target: $400
 0% 

set_task with cvars?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OmgHi
Junior Member
Join Date: Jan 2007
Old 01-31-2007 , 02:34   set_task with cvars?
Reply With Quote #1

Code:
set_task(get_cvar_num("fireballpulse"),"fireballpulsecheck",0,"",0,"b")

I get tag-mis match error, but I don't see any other way to do this....

How can I adjust the set_task time with a cvar like I attempted above...?

Any help would be greatly appriciated.

Thanks!
OmgHi is offline
Ramono
Veteran Member
Join Date: Nov 2005
Location: Netherlands
Old 01-31-2007 , 03:01   Re: set_task with cvars?
Reply With Quote #2

Code:
set_task(float(get_cvar_num("fireballpulse")),"fireballpulsecheck",0,"",0,"b")

or

Code:
set_task(get_cvar_float("fireballpulse"),"fireballpulsecheck",0,"",0,"b")


It has to be a float not a number.

a number = 1
a float = 1.0
__________________
Um, hi.
Ramono is offline
Ryu2877
Member
Join Date: Sep 2006
Location: China
Old 01-31-2007 , 03:03   Re: set_task with cvars?
Reply With Quote #3

task time must be float, so at first, must be:
Code:
get_cvar_float("something")
And others:
Code:
Syntax
set_task ( Float:time,const function[],id = 0,parameter[]="",len = 0,flags[]="", repeat = 0 ) 
Type
Native 
Notes
Flags: 
"a" - repeat. 
"b" - loop task. 
"c" - do task on time after a map timeleft. 
"d" - do task on time before a map timelimit. 

Example of executing a task once. 

set_task(15.0,"MyFunction") 


Remember that functions executed by set_task needs be public
Ryu2877 is offline
OmgHi
Junior Member
Join Date: Jan 2007
Old 01-31-2007 , 13:25   Re: set_task with cvars?
Reply With Quote #4

Wow thanks!

Whats the difference between a-repeat, and b-loop task?
OmgHi is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 01-31-2007 , 13:35   Re: set_task with cvars?
Reply With Quote #5

a repeats x ammount of times ( x = the last argument of set task )
b repeats untill stopped or forever.

ex:
set_task(1.0, "func", 0, "", 0, "a", 5)
repeats "func" 5 times.

set_task(1.0, "func", 0, "", 0, "b")
repeats forever.
[ --<-@ ] Black Rose is offline
Reply


Thread Tools
Display Modes

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 00:43.


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