Raised This Month: $12 Target: $400
 3% 

AutoExecConfig Question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mr.Freeman
Senior Member
Join Date: Nov 2013
Location: Canada
Old 05-22-2015 , 09:02   AutoExecConfig Question
Reply With Quote #1

Is there any way of fetching the .cfg file from a webserver. Example being http://websitehere.com/configs/plugin.cfg. This would save me hours when I have to reupload the config each month to my 50+ servers just to change the cvar value for Months.

Let me know how or if this exists, even willing to pay if this is top secret!
Freeman
__________________
Feel Free to PM me about any questions, I'll do my best to help

Last edited by Mr.Freeman; 05-22-2015 at 09:03.
Mr.Freeman is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 05-22-2015 , 10:02   Re: AutoExecConfig Question
Reply With Quote #2

the curl extension would let you download the file, but it'd probably be easier to use just some external software for syncing files like that
Miu is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 05-22-2015 , 10:03   Re: AutoExecConfig Question
Reply With Quote #3

Quote:
Originally Posted by Mr.Freeman View Post
just to change the cvar value for Months.
Have you thought about updating the plugin / having someone else update the plugin so it doesn't require you to change its cvars on a monthly basis?
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Mr.Freeman
Senior Member
Join Date: Nov 2013
Location: Canada
Old 05-22-2015 , 10:17   Re: AutoExecConfig Question
Reply With Quote #4

Never thought of that Powerlord, would there be way to fetch date through sourcemod like the Time function. I was looking at a UNIX Timestamp style from MYSQL (https://forums.alliedmods.net/showthread.php?t=162537) but I would prefer the month to change automatically without the need for MYSQL. New to this system, if you require the source i can upload what I have to help make it easier to understand my request.

Thanks,
Freeman
__________________
Feel Free to PM me about any questions, I'll do my best to help
Mr.Freeman is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 05-22-2015 , 10:53   Re: AutoExecConfig Question
Reply With Quote #5

Quote:
Originally Posted by Mr.Freeman View Post
Never thought of that Powerlord, would there be way to fetch date through sourcemod like the Time function. I was looking at a UNIX Timestamp style from MYSQL (https://forums.alliedmods.net/showthread.php?t=162537) but I would prefer the month to change automatically without the need for MYSQL. New to this system, if you require the source i can upload what I have to help make it easier to understand my request.

Thanks,
Freeman
SourcePawn has things for dealing with UNIX timestamps. GetTime returns a UNIX Timestamp. FormatTime turns a UNIX timestamp into a formatted string. If you don't pass a timestamp to FormatTime, it uses the current time.

So, if you wanted to get the month as a number...

PHP Code:
new month;
new 
String:strMonth[3];
FormatTime(strMonthsizeof(strMonth), "%m")
month StringToInt(strMonth); 
Edit: If you're wondering where "%m" came from, it's because FormatTime uses the C strftime system call, which has a bunch of formatting strings defined. %m is "month as a decimal number (01-12)"
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 05-22-2015 at 10:57.
Powerlord is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 05-22-2015 , 17:30   Re: AutoExecConfig Question
Reply With Quote #6

Quote:
Originally Posted by Powerlord View Post
PHP Code:
new month;
new 
String:strMonth[3];
FormatTime(strMonthsizeof(strMonth), "%m")
month StringToInt(strMonth); 
+1 I use this in my monthly competition plugins.
KissLick is offline
Mr.Freeman
Senior Member
Join Date: Nov 2013
Location: Canada
Old 05-23-2015 , 17:28   Re: AutoExecConfig Question
Reply With Quote #7

I already use your menu builder, just another reason too +1 you powerlord! Thanks again!
__________________
Feel Free to PM me about any questions, I'll do my best to help
Mr.Freeman 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 07:46.


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