Raised This Month: $ Target: $400
 0% 

[Help] Load Config File With Variables


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 06-10-2009 , 08:44   Re: [Help] Load Config File With Variables
Reply With Quote #6

Code:
#include <amxmodx>   // In that file should be writen the CVar ant its value, like "amx_ffff 1" new ExecFilePath[] = "addons/New Folder/config.cfg";   new MyVar;   public plugin_init() {         MyVar = register_cvar("amx_ffff", "1"); // 1 - on, 0 - off           server_cmd("exec ^"%s^"", ExecFilePath); }   public SomeFunc() {         if (get_pcvar_num(MyVar))         {                 // Do stuff if MyVar is enabled         }         else         {                 // Do stuff if MyVar is disabled         } }
__________________

Last edited by hleV; 06-10-2009 at 08:46.
hleV 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 13:48.


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