AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   set_task with cvars? (https://forums.alliedmods.net/showthread.php?t=50645)

OmgHi 01-31-2007 02:34

set_task with cvars?
 
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!

Ramono 01-31-2007 03:01

Re: set_task with cvars?
 
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

Ryu2877 01-31-2007 03:03

Re: set_task with cvars?
 
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


OmgHi 01-31-2007 13:25

Re: set_task with cvars?
 
Wow thanks!

Whats the difference between a-repeat, and b-loop task?

[ --<-@ ] Black Rose 01-31-2007 13:35

Re: set_task with cvars?
 
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.


All times are GMT -4. The time now is 00:43.

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