AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   how would u combining a cvar into a task (https://forums.alliedmods.net/showthread.php?t=10735)

Crazywelder1 02-27-2005 18:35

how would u combining a cvar into a task
 
Example:
of what i want combined
so that when u change the cvar(mp_afktime) to something else that it changes the time when the task is done


Code:
register_cvar("mp_afktime", "90", FCVAR_SERVER) set_task(90.0,"isplayer",_,_,_,"b")

would u have to make a float or define??

like so
Code:
#define AFKTASK 5 register_cvar("mp_afktime", "90", FCVAR_SERVER) set_task(float(AFKTASK),"isplayer",_,_,_,"b")

then put down ways
new afktime get_cvar_num("mp_afktime")
AFKTASK += afktime

but that wouldn't work becuase it would be too late so i know that is wrong do u guys know what i should do?? (plz tell me if u dont understand what i mean ill explain it with more detail)

v3x 02-27-2005 18:58

Code:
register_cvar("mp_afktime", "90") new Float:afktime = get_cvar_float("mp_afktime") set_task(afktime,"isplayer",_,_,_,"b")

Crazywelder1 02-27-2005 20:06

thank you evne tho i have tried it but it doesn't work other make it slower and not do the task??

Twilight Suzuka 02-27-2005 21:57

well, what vex just suggests should change the time based on the cvar. Which means you need to reset the cvar to something lower or higher for the desired effect.


All times are GMT -4. The time now is 14:01.

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