Raised This Month: $ Target: $400
 0% 

Plguin Cvar From Cfg


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
M249-M4A1
I <3 Mac
Join Date: May 2005
Location: Not interested
Old 10-03-2007 , 15:44   Re: Plguin Cvar From Cfg
Reply With Quote #8

haha sorry, something like this:

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "M249-M4A1"

#define CONFIGPATH "addons/amxmodx/configs/"
#define CONFIGFILE "myconfig.cfg"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_concmd("amx_loadmahconfig""LOADITBABY"ADMIN_KICK"- execute a config file")
    
register_cvar("my_cvar""1")
    
register_cvar("my_other_cvar""abcdefghijk")
}

public 
LOADITBABY(id) {
    
server_cmd("exec %s/%s"CONFIGPATHCONFIGFILE)
    
// or, if you don't want to use defines:
    
server_cmd("exec addons/amxmodx/configs/myconfig.cfg")
    
    
// tell the client the config was executed
    
client_print(idprint_console"[AMXX] A configuration file was executed")
    
    return 
PLUGIN_HANDLED
}


/* 
    and inside of myconfig.cfg:
    
    // this is myconfig.cfg
    // sv_alltalk "0"
    // my_cvar "0"
    // my_other_cvar "abcdefg"
    
    */ 
__________________
M249-M4A1 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 16:11.


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