AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   cvar thing (https://forums.alliedmods.net/showthread.php?t=19320)

smallwimpyboy 10-14-2005 02:44

cvar thing
 
Code:
register_cvar("amx_cm_awardhp","5") cs_set_user_health(id,"+amx_cm_awardhp")

Im trying to make it so the persons goes up the ammount in
amx_cm_awardhp every second :? :? Please help and thanks in advanced

Zenith77 10-14-2005 10:39

Code:
register_cvar("amx_cm_awardhp","5") cs_set_user_health(id,"+amx_cm_awardhp")

Several mistakes here.

1) You tried to use a cvar as a string

2) The cvar is not a variable, so it can not be called as a variable, thats why we have get_cvar_num() ;)

3) You + it? + What? Not only that, the compiler would read it as a string at not an operator.

4) do this :)

Code:
register_cvar("amx_cm_awardhp","5") ... new health = get_user_health(id) new awardhp = get_cvar_num("amx_cm_awardhp") cs_set_user_health(id,health+awardhp)

:)


p.s. cs_set_user_health does not look for a string :P

smallwimpyboy 10-14-2005 13:39

Wow Thank you.
He He 1 more qeustion?

Code:
remove_task(0,"hpps",0) set_task(1.0,"hpps",id)
Would that remove task? if not then could you show me how?

[/small]

Zenith77 10-14-2005 13:49

remove_task(id)


:)

smallwimpyboy 10-14-2005 14:26

Thanks


All times are GMT -4. The time now is 23:40.

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