Setting a CVAR
Can you make a CVAR set to -1 if you're retrieving the CVAR with get_pcvar_num(g_cost)?
|
Re: Setting a CVAR
Yes you can, for example
PHP Code:
|
Re: Setting a CVAR
Quote:
|
Re: Setting a CVAR
Quote:
@fysiks: I think he is referring to -1 as the cvar, then getting the cvar and will it still return -1. So: Code:
Although, I'm not sure if it will default it to 0 or not. |
Re: Setting a CVAR
Quote:
|
Re: Setting a CVAR
I think he wants to force the cvar to be get as float so he wants it to be -1 if it is tried to get it as int, -1 representing blowing it up.
|
Re: Setting a CVAR
Quote:
|
Re: Setting a CVAR
What i want to do is set the cost of something via CVAR. -1 represents not needing to purchase (equip automatically) 0 would be free (still has to choose to equip it) and anything above that, obviously, would be the set price.
Code:
new pcvar_cost = register_cvar("Cost", 0) |
Re: Setting a CVAR
Quote:
|
Re: Setting a CVAR
Quote:
|
| All times are GMT -4. The time now is 00:20. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.