AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   AutoExecConfig does not run (https://forums.alliedmods.net/showthread.php?t=332973)

666 06-11-2021 11:47

AutoExecConfig does not run
 
the problem is that it does not create the configuration folder and does not execute the cvars in OnConfigsExecuted, is there any way to run there?


example
PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// Add your code here...
        
CVARS 
}

public 
OnConfigsExecuted()
{
    
AutoExecConfig(true);



fysiks 06-11-2021 21:54

Re: AutoExecConfig does not run
 
I think you're configuring it to automatically execute configs after the configs have already executed. Therefore, it won't ever execute the configs. You need to call AutoExecConfig() in plugin_init(). Then, you can read the settings that were executed in or after OnConfigsExecuted().

666 06-17-2021 12:57

Re: AutoExecConfig does not run
 
Quote:

Originally Posted by fysiks (Post 2749548)
I think you're configuring it to automatically execute configs after the configs have already executed. Therefore, it won't ever execute the configs. You need to call AutoExecConfig() in plugin_init(). Then, you can read the settings that were executed in or after OnConfigsExecuted().

perfect I put AutoExecConfig (true); in plugin_init () and in OnConfigsExecuted () how do I read and execute it again

fysiks 06-17-2021 22:00

Re: AutoExecConfig does not run
 
AutoExecConfig() has no purpose after OnConfigsExecuted() is called including in the function itself. It doesn't do any reading or executing of files, it only configures AMX Mod X to automatically execute plugin-specific configuration files after all other configs are executed.

If you need to execute a config file again at a later time, you would execute it with server_cmd("path/to/file/myConfig.cfg")

666 06-17-2021 22:42

Re: AutoExecConfig does not run
 
Quote:

Originally Posted by fysiks (Post 2750214)
AutoExecConfig() has no purpose after OnConfigsExecuted() is called including in the function itself. It doesn't do any reading or executing of files, it only configures AMX Mod X to automatically execute plugin-specific configuration files after all other configs are executed.

If you need to execute a config file again at a later time, you would execute it with server_cmd("path/to/file/myConfig.cfg")

thanks now i understand


All times are GMT -4. The time now is 19:52.

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