Raised This Month: $32 Target: $400
 8% 

AutoExecConfig does not run


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
666
Senior Member
Join Date: Mar 2015
Old 06-11-2021 , 11:47   AutoExecConfig does not run
Reply With Quote #1

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);

__________________
666 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-11-2021 , 21:54   Re: AutoExecConfig does not run
Reply With Quote #2

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().
__________________
fysiks is offline
666
Senior Member
Join Date: Mar 2015
Old 06-17-2021 , 12:57   Re: AutoExecConfig does not run
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
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
__________________
666 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-17-2021 , 22:00   Re: AutoExecConfig does not run
Reply With Quote #4

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")
__________________
fysiks is offline
666
Senior Member
Join Date: Mar 2015
Old 06-17-2021 , 22:42   Re: AutoExecConfig does not run
Reply With Quote #5

Quote:
Originally Posted by fysiks View Post
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
__________________
666 is offline
Reply


Thread Tools
Display Modes

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 21:12.


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