Raised This Month: $ Target: $400
 0% 

Cvar - Tag Mismatch


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-14-2007 , 17:46   Re: Cvar - Tag Mismatch
Reply With Quote #2

First it's better to use pcvar. ( http://wiki.alliedmods.net/Optimizin...#Cvar_Pointers )

Here an exemple :

Code:
    #include <amxmodx>         new         p_cvar_inum,         p_cvar_float,         p_cvar_string;         public plugin_init()     {         p_cvar_inum   = register_cvar( "my_cvar1", "1" );         p_cvar_float  = register_cvar( "my_cvar1", "2.0" );         p_cvar_string = register_cvar( "my_cvar1", "hello" );     }         MyFunc()     {         new iNum = get_pcvar_num( p_cvar_inum );         new Float:fValue = get_pcvar_float( p_cvar_float );                 new sArg[16];         get_pcvar_string( p_cvar_string, sArg, charsmax( sArg ) );             }

You have a 'tag mismatch' because you have omit a 'Float:' tag when you retrieve float value.
__________________

Last edited by Arkshine; 12-14-2007 at 18:00.
Arkshine is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:12.


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