get_cvar_num in menus help
I'm currently making a menu and I've bumped into a problem where ColorChat isn't sending a message. I'm pretty sure I've used the CVAR functions incorrectly. Any pointers?
No compiling errors are given. Includes: #include <amxmodx> #include <amxmisc> #include <colorchat> PHP Code:
|
Re: get_cvar_num in menus help
You have two identical if statements, which doesn't make any sense. Explain what you are trying to do.
Also, when dealing with numeric values, you would not use an ampersand (&) to compare values. Instead you would use two equal signs (==). So you would do if( get_cvar_num( "mp_friendlyfire" ) == 1 ) { // code here } What I would suggest is getting the pointer to the cvar in plugin_init and then using that pointer instead of getting a cvar num. That would work as such: PHP Code:
|
Re: get_cvar_num in menus help
@nikhilgupta345
You could also change set_cvar_num to set_pcvar_num :) |
Re: get_cvar_num in menus help
Quote:
|
| All times are GMT -4. The time now is 05:52. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.