Raised This Month: $ Target: $400
 0% 

ConfigFramework – framework to facilitate the management of configs


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarkGL
Senior Member
Join Date: Aug 2010
Location: Warsaw, Poland
Old 01-27-2015 , 04:46   ConfigFramework – framework to facilitate the management of configs
Reply With Quote #1

It is a project which aim was to facilitate the work and management of configs and add functionality that was not previously in amxx.

Throwing a framework to the project gain access to two new forwards

PHP Code:
plugin_config
plugin_config_loaded 
and one new public function

PHP Code:
CFWInitializeconfigName[] ) 
plugin_config – It is executed before plugin_precache so it is first function running in plugin. In this forward you have to register all cvars. Also register_cvar function was changed there is one new parametr - description.

Example:
PHP Code:
register_cvar"test_cvar" "1" ,.description "Testowy cvar" ); 
Second forward plugin_config_loaded is started after all cvars are loaded it is still running before plugin_precache.

In this forward you should get all values from the cvars which you need.

Function CFWInitialize( configName[] ) have to be used in plugin_config forward

Example

PHP Code:
CFWInitialize"testConfig" ); 
First parametr is config name.

Private methods in framework:

PHP Code:
__CFWregister_cvar
__CFWloadConfig
__CFWsaveConfig 
You should use them only if you know what are you doing.

All plugin config will be in configs/plugin/ folder

Example:

PHP Code:
configs/plugin/configName.cfg 
Example:

PHP Code:
/* Script generated by Pawn Studio */

#include <amxmodx>
#include <amxmisc>

#include "config"

#define PLUGIN    "testConfig"
#define AUTHOR    "DarkGL"
#define VERSION    "1.0"

new cvarResult;

#pragma unused cvarResult

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
}

public 
plugin_precache(){
}

public 
plugin_cfg(){
}

public 
plugin_config(){
    
CFWInitialize"testConfig" );
    
    
register_cvar"test_cvar" "1" ,.description "Testowy cvar" );
}

public 
plugin_config_loaded(){
    
cvarResult get_cvar_num"test_cvar" );
    
    
log_amx"config loaded cvarResult: %d" cvarResult );

http://darkgl.amxx.pl/index.php/2014...nia-configami/
Attached Files
File Type: inc config.inc (2.9 KB, 223 views)
__________________
DarkGL is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 01-29-2015 , 10:03   Re: ConfigFramework – framework to facilitate the management of configs
Reply With Quote #2

PHP Code:
    new tmpArray__CFWcvarsStructure ];
    
    
#pragma unused tmpArray
    
    
__CFWcvarsList ArrayCreatesizeoftmpArray ) , ); 

PHP Code:
    __CFWcvarsList ArrayCreate_:__CFWcvarsStructure ); 
__________________

Last edited by hleV; 01-29-2015 at 10:04.
hleV is offline
devilicioux
Veteran Member
Join Date: Jun 2013
Location: Delhi,India
Old 02-11-2015 , 00:44   Re: ConfigFramework – framework to facilitate the management of configs
Reply With Quote #3

Impressive !! Good Job
__________________
You keep bringing ANTICHRISTUS down .. He will rise again and kick asses !

#RespectList ANTICHRISTUS fysiks Bugsy

Most Common Errors You Can Encounter Every Now and Then
devilicioux is offline
BaD CopY
Senior Member
Join Date: Oct 2014
Location: Home
Old 02-11-2015 , 03:53   Re: ConfigFramework – framework to facilitate the management of configs
Reply With Quote #4

GJ
BaD CopY is offline
Send a message via Yahoo to BaD CopY Send a message via Skype™ to BaD CopY
Reply



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 15:48.


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