Raised This Month: $174 Target: $400
 43% 

[INCLUDE] AutoExecConfig: Read and append to auto configs


Post New Thread Reply   
 
Thread Tools Display Modes
Crasher_3637
AlliedModders Donor
Join Date: May 2012
Old 04-13-2018 , 06:47   Re: [INCLUDE] AutoExecConfig: Read and append to auto configs
Reply With Quote #51

Is it possible to use multiple AutoExecConfig_SetFile() to create multiple autoconfig files?

I'm asking because AutoExecConfig() doesn't allow multiple callbacks if autocreate is set to true for all the callbacks.

Example:

AutoExecConfig(true, "blah");
AutoExecConfig(true, "blarg");

Would only create blah.cfg but not blarg.cfg

Just wanna know if your include is also limited by that.
__________________
AFK like JFK

Last edited by Crasher_3637; 04-13-2018 at 06:49.
Crasher_3637 is offline
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 04-13-2018 , 07:10   Re: [INCLUDE] AutoExecConfig: Read and append to auto configs
Reply With Quote #52

Yes that's possible. I'm not sure what you mean with callbacks.
__________________

Last edited by Impact123; 04-13-2018 at 07:47.
Impact123 is offline
Crasher_3637
AlliedModders Donor
Join Date: May 2012
Old 04-13-2018 , 07:39   Re: [INCLUDE] AutoExecConfig: Read and append to auto configs
Reply With Quote #53

Quote:
Originally Posted by Impact123 View Post
Yes, that's possible. I'm not sure what you mean with callbacks.
Oh, my bad. I meant just calling AutoExecConfig() multiple times, not callbacks.

Thanks btw!
__________________
AFK like JFK

Last edited by Crasher_3637; 04-13-2018 at 07:39.
Crasher_3637 is offline
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 04-13-2018 , 07:48   Re: [INCLUDE] AutoExecConfig: Read and append to auto configs
Reply With Quote #54

Here's an example which would create 2 config files
PHP Code:
AutoExecConfig_SetCreateFile(true);

AutoExecConfig_SetFile("test1");
AutoExecConfig_CreateConVar("test1""1""Test1");
AutoExecConfig_ExecuteFile();

AutoExecConfig_SetFile("test2");
AutoExecConfig_CreateConVar("test2""1""Test2");
AutoExecConfig_ExecuteFile(); 
The important part which i forgot to mention is using

PHP Code:
AutoExecConfig_SetCreateFile(true); 
__________________
Impact123 is offline
Crasher_3637
AlliedModders Donor
Join Date: May 2012
Old 04-13-2018 , 18:18   Re: [INCLUDE] AutoExecConfig: Read and append to auto configs
Reply With Quote #55

Would this work as well?

PHP Code:
AutoExecConfig_SetCreateFile(true);
AutoExecConfig_SetFile("test1");
AutoExecConfig_SetFile("test2");
AutoExecConfig_CreateConVar("sm_test1""1""test1");
AutoExecConfig_CreateConVar("sm_test2""2""test2");
AutoExecConfig_ExecuteFile(); 
__________________
AFK like JFK

Last edited by Crasher_3637; 04-13-2018 at 18:51.
Crasher_3637 is offline
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old 04-14-2018 , 00:02   Re: [INCLUDE] AutoExecConfig: Read and append to auto configs
Reply With Quote #56

No. If you use
PHP Code:
AutoExecConfig_SetFile 
you're just setting a few global variables that will be used by the other functions to read, create, append, etc. If you use it like that you would immediately overwrite test1 with test2.
__________________

Last edited by Impact123; 04-14-2018 at 00:06.
Impact123 is offline
Crasher_3637
AlliedModders Donor
Join Date: May 2012
Old 04-14-2018 , 00:34   Re: [INCLUDE] AutoExecConfig: Read and append to auto configs
Reply With Quote #57

Quote:
Originally Posted by Impact123 View Post
No. If you use
PHP Code:
AutoExecConfig_SetFile 
you're just setting a few global variables that will be used by the other functions to read, create, append, etc. If you use it like that you would immediately overwrite test1 with test2.
Alright, that makes sense. Thanks!
__________________
AFK like JFK
Crasher_3637 is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old Yesterday , 16:53   Re: [INCLUDE] AutoExecConfig: Read and append to auto configs
Reply With Quote #58

Where's the file?
__________________
Accepting private work. Contact me if you're interested.
If you like my work, feel free to donate in appreciation with PayPal or CSGO Skins.
eyal282 is offline
Impact123
Veteran Member
Join Date: Oct 2011
Location: Germany
Old Yesterday , 17:54   Re: [INCLUDE] AutoExecConfig: Read and append to auto configs
Reply With Quote #59

That depends on what you pass to AutoExecConfig_SetFile. By default it's created inside the cfg/sourcemod folder.
__________________

Last edited by Impact123; Yesterday at 17:56.
Impact123 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 04:12.


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