AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Help] Load Config File With Variables (https://forums.alliedmods.net/showthread.php?t=94344)

exec0d3 06-10-2009 05:51

[Help] Load Config File With Variables
 
Hi all :)
I whant to load .cfg file with configurations for my plugin ...
And I whant to load it from ... addons\New Folder\config.cfg ...

Please, write example plugin for me :)

Thanks for attention :)

Arkshine 06-10-2009 06:00

Re: [Help] Load Config File With Variables
 
There are a lot of plugins which do that. Start to search before, it will be more faster for you.

exec0d3 06-10-2009 06:04

Re: [Help] Load Config File With Variables
 
For example, which?

hleV 06-10-2009 07:00

Re: [Help] Load Config File With Variables
 
Code:
#include <amxmodx>   new ExecFilePath[] = "addons/New Folder/config.cfg";   public plugin_init()         server_cmd("exec ^"%s", ExecFilePath);

exec0d3 06-10-2009 07:52

Re: [Help] Load Config File With Variables
 
Thanks, but how to get variables?
like this:
PHP Code:

new MyVar
 
public plugin_init(){
MyVar register_cvar("amx_FFFF","yes")



hleV 06-10-2009 08:44

Re: [Help] Load Config File With Variables
 
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         } }

exec0d3 06-10-2009 11:17

Re: [Help] Load Config File With Variables
 
Thanks


All times are GMT -4. The time now is 13:48.

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