AlliedModders

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

n0br41ner 06-17-2012 19:25

cvar never used? :?
 
I am using the following:

PHP Code:

new mycvar;

public 
plugin_init() {
     
mycvar register_cvar("amx_mycvar""1");

     
/*some code here*/

     
if(get_cvar_num("mycvar") == 1/*or should i put "amx_mycvar" instead of "mycvar" ?*/
          
MyFunction();
}

public 
MyFunction() {
     
/*some code here*/


And when compiling i get:
Code:

warning 204: symbol is assigned a value that is never used: "amx_mycvar"
It compiles successfully but i am getting the warning
Am i doing something wrong?

guipatinador 06-17-2012 19:44

Re: cvar never used? :?
 
Try get_pcvar_num instead of get_cvar_num and remove the "" from mycvar.

PHP Code:

if(get_pcvar_num(mycvar) == 1



n0br41ner 06-17-2012 19:47

Re: cvar never used? :?
 
thank you :D
it worked


All times are GMT -4. The time now is 06:18.

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