Raised This Month: $ Target: $400
 0% 

Auto Change cvars/amxx files [Fixed]


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Server Management       
Texnux
Member
Join Date: Mar 2008
Location: Denmark
Old 07-04-2008 , 17:41   Auto Change cvars/amxx files [Fixed]
Reply With Quote #1

Auto Change - 1.1.2, by Texnux - Updated 29-10-2008

Ideas/Suggestions/Feedback:
Got any features that may make this server management plugin better? Please tell!

Reason for plugin:
I dunno how you guys feels when it comes to manage plugins and cvars depending on players on your server, but I hated the time consuming job of turning off plugins and features through cvars to stop lag or to please some players, that want certain things off when there is x players. So I searched for such plugin, it may exist, but I didn't find one, so i took the job of creating one myself and this is the result I have right now!

Description:
This plugin pause/unpause/change cvars upon the number of players on the server.

Say if you experience lags with some plugins when you excides 20 players, you would have to turn that plugin off manually, but with Auto Change it does all that automatically and even turns it on again when players drop below that value!

Example:
A player joins and there is now 20 players - PluginX.amxx turns off
A player leaves and there is now 19 players - PluginX.amxx turns on again

The same can be done with cvars! It can change the default value to something else!

Features:
- Change cvars value upon players ingame
- Pause/Unpause Plugins upon players ingame
- Change back again when players leave, and there is less than that value that paused/unpaused/changed cvar value in the first place
- Config file to load it all automatically upon player (dis)connection
- Automatically create the config file (auto_change.ini)
- In game adding to the config file

Things I may add:
- Make a backup of config through game/mod before resetting - is it possible?
- Create a second config file that loads settings upon modes - Example you have some plugins, when you turn to mode 1 it loads those plugins/cvars, then you change to mode 2 and mode 2 settings load right after mode 1's settings have been resetted
- Delete a line from the config file
- Edit a line from config file - is it possible?

Admin commands:
amx_autoc_reset_config - Resets config file
amx_autoc_load_config - Loads config file
amx_autoc_write - Read the guide

Cvars:
Auto_change_use - 0 = blocks both amx(x) files and cvars, 1 = loads both amxx and cvars, 2 = loads only cvars, 3 loads only amx(x) files.

Amx_autoc_write the guide:
There is also in game help! Leave it blank or write guide to read it in game in console.

amx_autoc_write guide or "" brings up the guide!

amx_autoc_write has 6 arguments!

1 = the player number required to change settings for that specific thing
2 = cvar or amxx/amx - decide wether it is a cvar or a plugin you want to change - decide if it is an .amxx or .amx file
3 = the plugin/cvar - plugins are case sensitive - .amxx and .amx are added automatically!
4 = If cvar it is value, for .amx(x) files it is unpause/pause
5 = For .amx(x) files use on/off, for cvars use number. On means that if you choice to pause it unpause when it players drops below x number again! X = 20 in the example. For cvars the number is the default/new number you want when it drops below x players again.
6 = Comments! // are added automatically! You don't need to specify this, but you can add comments! It adds // no matter what, incase for later use! You have to write your comment inside "" quotes!

Example for amxx/amx: amx_autoc_write 15 amxx/amxx pluginX on "my comment here"
Example for cvars: amx_autoc_write 12 cvar mp_friendlyfire 1 0 "my comment here"

Credits:
Schnitzelmaker - http://forums.alliedmods.net/showthr...ghlight=config - Using files to write/read data tutorial

Changelog:
Version 1.0.0
- Initial release
Version 1.1.1
- Some small bugs fixed
- Added a cvar: auto_change_use
- Added message when you succesfully added a line to the config file
Version 1.1.2
- Important bug fixes


- Texnux
Attached Files
File Type: sma Get Plugin or Get Source (auto_change.sma - 1304 views - 8.3 KB)

Last edited by Texnux; 10-29-2008 at 14:49.
Texnux is offline
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 07-04-2008 , 18:07   Re: Auto Change cvars/amxx files
Reply With Quote #2

Very good idea. Thanks
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
bmann_420
AMX_Super Pooper
Join Date: Jan 2005
Location: [SuperCentral.co]
Old 07-05-2008 , 03:15   Re: Auto Change cvars/amxx files
Reply With Quote #3

Wow, I think that has been in the back of all our minds for a while. Very original indeed.
__________________
bmann_420 is offline
IneedHelp
Veteran Member
Join Date: Mar 2007
Location: Argentina
Old 07-05-2008 , 03:40   Re: Auto Change cvars/amxx files
Reply With Quote #4

nice plugin, gj.
__________________
IneedHelp is offline
Blubb
Member
Join Date: May 2008
Location: Germany
Old 07-05-2008 , 05:46   Re: Auto Change cvars/amxx files
Reply With Quote #5

very nice plugin
Blubb is offline
Send a message via ICQ to Blubb
soccdoodcss
Veteran Member
Join Date: Nov 2006
Location: Wisconsin
Old 07-07-2008 , 02:48   Re: Auto Change cvars/amxx files
Reply With Quote #6

Great idea. Will probably check it out soon.
__________________
"Now safe beneath their wisdom and their feet.
Here I will teach you truly how to sleep."
soccdoodcss is offline
Send a message via AIM to soccdoodcss
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 08-12-2008 , 20:20   Re: Auto Change cvars/amxx files
Reply With Quote #7

Waiting for somebody to say this works before it can be approved!
Styles is offline
Send a message via AIM to Styles
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 08-12-2008 , 20:51   Re: Auto Change cvars/amxx files
Reply With Quote #8

what if there are plugins that restart the round when their value is changed?

a player logs in - 20 players - restart round.
he loggs off - 19 players - restart round.
then apperantly he used retry/reconnect - 20 players - restart round.

not so bad so far? now imagine that the above player is very quick
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
Texnux
Member
Join Date: Mar 2008
Location: Denmark
Old 08-30-2008 , 11:21   Re: Auto Change cvars/amxx files
Reply With Quote #9

Quote:
Originally Posted by dor123 View Post
what if there are plugins that restart the round when their value is changed?
I don't really think there is anything I can do to avoid that. That would be a reason to NOT put the plugin on the auto change list.

- Texnux
Texnux is offline
Old 08-30-2008, 19:03
cdef432
This message has been deleted by BAILOPAN. Reason: spam
singularity
Junior Member
Join Date: Dec 2007
Old 09-08-2008 , 11:06   Re: Auto Change cvars/amxx files
Reply With Quote #10

Is it possible to fix so that the plugins get unpaused casue of a cvar. Like if i use 10 airaccelerate (sv_airaccelerate 10) it loads a plugin that only works for 10 airaccelerate and if i got 100 airaccelerate (sv_airaccelerate 100) it loads the same plugin just edited for 100. If this is possible can some one explain it to me please.

(i already got another plugin that will edited the airaccelerate for me)
singularity is offline
Reply



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 19:02.


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