Raised This Month: $ Target: $400
 0% 

A simple question...


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
AceVentura
Member
Join Date: Mar 2020
Location: Ontario, Canada
Old 05-04-2020 , 15:03   A simple question...
Reply With Quote #1

For a cvar to be accessible via a .cfg file, shall i do it like this?

PHP Code:
public plugin_init()
{
    
gCreditKill   =   register_cvar"normal_kill""1" )
    
gCreditHs    =   register_cvar"headshot_kill""2" )
    
gCreditHe    =   register_cvar"henade_kill""3" )
    
gCreditKnife =   register_cvar"knife_kill""5" )
    
gVipCosts     =   register_cvar"vip_costs""3600" )
     
    
LoadConfig()
}

LoadConfig( )
{
    new 
config[64];
    
get_configsdir(configcharsmax(config));
    
add(configcharsmax(config), "/credits.cfg");

    if(
file_exists(config)) 
    {
        
server_cmd("exec %s"config);
        
server_exec();
    }

And, then, add all cvars in the file. (credits.cfg in this case)

credits.cfg
__________________
So.. animals CAN sense evil!

Last edited by AceVentura; 05-04-2020 at 15:11.
AceVentura 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 17:09.


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