How to make sure a variable is not unset
Code:
g_blah = register_cvar("amx_blah","") |
Re: How to make sure a variable is not unset
Code:
Code:
These should work. ( You might wanna trim before the first one, so better use the second one ) |
Re: How to make sure a variable is not unset
Quote:
|
Re: How to make sure a variable is not unset
Show more code. A variable can be used for anything. It depends if you need a number, float, string, etc.
|
Re: How to make sure a variable is not unset
To check if a cvar is truly unset you should probably get_pcvar_string and check what i told you before.
|
Re: How to make sure a variable is not unset
Quote:
|
Re: How to make sure a variable is not unset
That doesn't make sense, show the code please.
|
Re: How to make sure a variable is not unset
Code:
snip |
Re: How to make sure a variable is not unset
Code:
This is wrong. register_cvar always returns an integer and it's a cvar pointer to a cvar, which you can use to get_pcvar. Along with that Code:
This is wrong. First of all the first argument is a cvar pointer you got from registering a cvar, in your case this throws an error. Also length should be sizeof - 1 ( In your case 31, or just use charsmax(buffer) ) This native returns a number of cells written to a buffer, so keep that in mind. |
Re: How to make sure a variable is not unset
Quote:
Quote:
|
| All times are GMT -4. The time now is 12:25. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.