Raised This Month: $ Target: $400
 0% 

cvar thing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
smallwimpyboy
Senior Member
Join Date: Aug 2005
Location: United States
Old 10-14-2005 , 02:44   cvar thing
Reply With Quote #1

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
smallwimpyboy is offline
Send a message via AIM to smallwimpyboy Send a message via MSN to smallwimpyboy
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-14-2005 , 10:39  
Reply With Quote #2

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
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
smallwimpyboy
Senior Member
Join Date: Aug 2005
Location: United States
Old 10-14-2005 , 13:39  
Reply With Quote #3

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]
smallwimpyboy is offline
Send a message via AIM to smallwimpyboy Send a message via MSN to smallwimpyboy
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-14-2005 , 13:49  
Reply With Quote #4

remove_task(id)


__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
smallwimpyboy
Senior Member
Join Date: Aug 2005
Location: United States
Old 10-14-2005 , 14:26  
Reply With Quote #5

Thanks
smallwimpyboy is offline
Send a message via AIM to smallwimpyboy Send a message via MSN to smallwimpyboy
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 23:40.


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