AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Module Coding (https://forums.alliedmods.net/forumdisplay.php?f=9)
-   -   [SOLVED] Cvar value not correct (https://forums.alliedmods.net/showthread.php?t=242939)

OvidiuS 06-27-2014 08:10

[SOLVED] Cvar value not correct
 
My cvar always has value 1.
I put run_on_start 0 in amxx.cfg but printf is always called.

Code:

void OnMetaAttach( void )
{
        cvar_t runonstart_cvar = { "run_on_start", "1" };
        g_engfuncs.pfnCVarRegister( &runonstart_cvar );
}


void StartFrame_Post( void )
{
        if( g_engfuncs.pfnCVarGetFloat( "run_on_start" ) )
                printf( "runonstart" );

        RETURN_META( MRES_IGNORED );
}

What am i doing wrong?

EDIT: typo in amxx.cfg

claudiuhks 06-27-2014 23:23

Re: [SOLVED] Cvar value not correct
 
Try to get the pointer. Check Semiclip module.

OvidiuS 06-28-2014 11:29

Re: [SOLVED] Cvar value not correct
 
Thanks, i did that after i started this thread :D
It was a typo, but i also changed module to use pointers.


All times are GMT -4. The time now is 15:52.

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