AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Execute Configs 1.0 (Updated 08/12/09) (https://forums.alliedmods.net/showthread.php?t=67620)

DJ Tsunami 02-27-2008 10:15

Execute Configs 1.0 (Updated 2020/08/05)
 
10 Attachment(s)
This plugin executes configs when there are either a certain amount of clients on, a certain event occurs, a certain round starts or when there are a certain amount of minutes left on the map. You can use this to disable alltalk above x clients, or to change the map when the timelimit hits, etc. The configs of course go into the cfg folder and the console variables are as follows:

sm_executeconfigs_enabled (0/1, def 1)
Enable/disable executing configs. The plugin will keep counting the rounds and timeleft when it's disabled, but it will only actually execute the configs when it's enabled.

sm_executeconfigs_include_bots
(0/1, def. 1)
Enable/disable including bots when counting number of clients. This will allow you to disable counting fake clients as normal clients.

sm_executeconfigs_include_spec
(0/1, def. 1)
Enable/disable including spectators when counting number of clients. This will allow you to disable counting spectators as normal clients.

sm_executeconfigs_reload
Server command to reload the configs from executeconfigs.txt.


To customize which configs get executed, put the attached executeconfigs.txt in the configs folder. It contains some examples of which I'll explain one here:

Code:

"Configs"
{
    "*"
    {
        "clients:0"    "10:emptyserver.cfg"
    }
}

This means that for all maps, when there are 0 clients on, emptyserver.cfg will get executed after 10 seconds. The delay is for when someone joins within those 10 seconds, it will look for a config for when there is 1 client on, and if found it will execute that line. If it wasn't found it will continue to execute emptyserver.cfg, so if you're changing the map in emptyserver.cfg, make sure it will stop doing that by creating an empty config for clients:1.

I've tested this on TF2, I'm sure it works on others too but bug reports are always welcome :)

Changelog
  • 1.0
    • Rewrote most of the code to allow for easier additions.
    • Added support for map specific configs.
    • Added sm_executeconfigs_reload.
  • 0.5.3
    • Fixed invalid timer handle errors.
  • 0.5.2
    • Removed a stray LogMessage.
  • 0.5.1
    • Small fix when counting number of clients.
  • 0.5
    • Fixed timer errors.
    • Added sm_executeconfigs_include_spec.
    • Does not execute the found config if it is the last config that was executed.
  • 0.4
    • Initial public release.

dann 02-28-2008 20:36

Re: Execute Configs
 
could you add something like this?

sm_executeconfigs_include_spectators 0/1

John Ford 02-29-2008 13:01

Re: Execute Configs
 
Let me get this straight. The emptyserver.cfg goes in the /cfg folder?
To load a new or the next map what would I enter? I tried using your change2nextmap.smx plugin and got this error.

CModelLoader::Map_IsValid: No such map 'maps/Pending Vote.bsp'
L 02/29/2008 - 12:52:17: [change2nextmap.smx] Map Name "Pending Vote" Invalid.

I like the idea of the server rotating through maps even though there are no clients. I just don't know how to invoke that map change.

DJ Tsunami 02-29-2008 16:06

Re: Execute Configs
 
dann: sure, I can add that. I'm assuming that's spectators that aren't bots?

John: yes, the emptyserver.cfg goes into the cfg folder. To change to the next map just have the command sm_change2nextmap in there. It looks like you're using the mapchooser plugin which initiates a vote at the end of the map, and before that vote is finished no next map is set (and ofcourse when there are no clients on noone ever votes). I'll have a look at how you can fix that.

dann 03-01-2008 06:38

Re: Execute Configs
 
yes actual spectators, not bots.

thanks

John Ford 03-01-2008 08:10

Re: Execute Configs
 
I removed the mapchooser plugin. When I use sm_change2nextmap the console tells me unknown command. If that is any help?

DJ Tsunami 03-01-2008 14:21

Re: Execute Configs
 
Type "sm plugins list" and make sure it's loaded, if it is it should work...

Edit: oh, and it has to be ran on the server console. So through rcon if you're executing it in-game.

arm5ky 03-03-2008 06:25

Re: Execute Configs
 
Doesnt work on our tf2 server :

L 03/03/2008 - 11:00:26: [SM] To enable debug mode, edit plugin_settings.cfg, or type: sm plugins debug 11 on
L 03/03/2008 - 11:02:54: [SM] Native "KillTimer" reported: Invalid timer handle 2380114 (error 1)
L 03/03/2008 - 11:02:54: [SM] Debug mode is not enabled for "executeconfigs.smx"

FroL 03-05-2008 13:57

Re: Execute Configs
 
thx for usefull plugin!

FroL 03-05-2008 15:49

Re: Execute Configs
 
But what is it?
Code:

L 03/05/2008 - 23:44:45: [SM]  [0]  Line 99, executeconfigs.sp::ExecClientsConfig()
L 03/05/2008 - 23:44:45: [SM]  [1]  Line 73, executeconfigs.sp::OnClientPutInServer()
L 03/05/2008 - 23:44:47: [SM] Native "KillTimer" reported: Invalid timer handle ea00e3 (error 3)
L 03/05/2008 - 23:44:47: [SM] Displaying call stack trace for plugin "executeconfigs.smx":
L 03/05/2008 - 23:44:47: [SM]  [0]  Line 99, executeconfigs.sp::ExecClientsConfig()
L 03/05/2008 - 23:44:47: [SM]  [1]  Line 73, executeconfigs.sp::OnClientPutInServer()
L 03/05/2008 - 23:44:47: [SM] Native "KillTimer" reported: Invalid timer handle ea00e3 (error 3)
L 03/05/2008 - 23:44:47: [SM] Displaying call stack trace for plugin "executeconfigs.smx":
L 03/05/2008 - 23:44:47: [SM]  [0]  Line 99, executeconfigs.sp::ExecClientsConfig()
L 03/05/2008 - 23:44:47: [SM]  [1]  Line 73, executeconfigs.sp::OnClientPutInServer()
L 03/05/2008 - 23:44:47: [SM] Native "KillTimer" reported: Invalid timer handle ea00e3 (error 3)
L 03/05/2008 - 23:44:47: [SM] Displaying call stack trace for plugin "executeconfigs.smx":
L 03/05/2008 - 23:44:47: [SM]  [0]  Line 99, executeconfigs.sp::ExecClientsConfig()
L 03/05/2008 - 23:44:47: [SM]  [1]  Line 73, executeconfigs.sp::OnClientPutInServer()
L 03/05/2008 - 23:44:47: [SM] Native "KillTimer" reported: Invalid timer handle ea00e3 (error 3)
L 03/05/2008 - 23:44:47: [SM] Displaying call stack trace for plugin "executeconfigs.smx":
L 03/05/2008 - 23:44:47: [SM]  [0]  Line 99, executeconfigs.sp::ExecClientsConfig()
L 03/05/2008 - 23:44:47: [SM]  [1]  Line 73, executeconfigs.sp::OnClientPutInServer()
L 03/05/2008 - 23:44:47: [SM] Native "KillTimer" reported: Invalid timer handle ea00e3 (error 3)
L 03/05/2008 - 23:44:47: [SM] Displaying call stack trace for plugin "executeconfigs.smx":
L 03/05/2008 - 23:44:47: [SM]  [0]  Line 99, executeconfigs.sp::ExecClientsConfig()
L 03/05/2008 - 23:44:47: [SM]  [1]  Line 73, executeconfigs.sp::OnClientPutInServer()
L 03/05/2008 - 23:44:47: [SM] Native "KillTimer" reported: Invalid timer handle ea00e3 (error 3)
L 03/05/2008 - 23:44:47: [SM] Displaying call stack trace for plugin "executeconfigs.smx":
L 03/05/2008 - 23:44:47: [SM]  [0]  Line 99, executeconfigs.sp::ExecClientsConfig()
L 03/05/2008 - 23:44:47: [SM]  [1]  Line 73, executeconfigs.sp::OnClientPutInServer()
L 03/05/2008 - 23:44:47: [SM] Native "KillTimer" reported: Invalid timer handle ea00e3 (error 3)
L 03/05/2008 - 23:44:47: [SM] Displaying call stack trace for plugin "executeconfigs.smx":
L 03/05/2008 - 23:44:47: [SM]  [0]  Line 99, executeconfigs.sp::ExecClientsConfig()
L 03/05/2008 - 23:44:47: [SM]  [1]  Line 73, executeconfigs.sp::OnClientPutInServer()
L 03/05/2008 - 23:44:47: [SM] Native "KillTimer" reported: Invalid timer handle ea00e3 (error 3)
L 03/05/2008 - 23:44:47: [SM] Displaying call stack trace for plugin "executeconfigs.smx":
L 03/05/2008 - 23:44:47: [SM]  [0]  Line 99, executeconfigs.sp::ExecClientsConfig()
L 03/05/2008 - 23:44:47: [SM]  [1]  Line 73, executeconfigs.sp::OnClientPutInServer()
L 03/05/2008 - 23:45:06: [SM] Native "KillTimer" reported: Invalid timer handle ea00e3 (error 3)
L 03/05/2008 - 23:45:06: [SM] Displaying call stack trace for plugin "executeconfigs.smx":
L 03/05/2008 - 23:45:06: [SM]  [0]  Line 99, executeconfigs.sp::ExecClientsConfig()
L 03/05/2008 - 23:45:06: [SM]  [1]  Line 77, executeconfigs.sp::OnClientDisconnect()
L 03/05/2008 - 23:45:06: [SM] Native "KillTimer" reported: Invalid timer handle ea00e3 (error 3)
L 03/05/2008 - 23:45:06: [SM] Displaying call stack trace for plugin "executeconfigs.smx":
L 03/05/2008 - 23:45:06: [SM]  [0]  Line 99, executeconfigs.sp::ExecClientsConfig()
L 03/05/2008 - 23:45:06: [SM]  [1]  Line 77, executeconfigs.sp::OnClientDisconnect()
L 03/05/2008 - 23:45:06: [SM] Native "KillTimer" reported: Invalid timer handle ea00e3 (error 3)
L 03/05/2008 - 23:45:06: [SM] Displaying call stack trace for plugin "executeconfigs.smx":
L 03/05/2008 - 23:45:06: [SM]  [0]  Line 99, executeconfigs.sp::ExecClientsConfig()
L 03/05/2008 - 23:45:06: [SM]  [1]  Line 77, executeconfigs.sp::OnClientDisconnect()
L 03/05/2008 - 23:45:06: [SM] Native "KillTimer" reported: Invalid timer handle ea00e3 (error 3)
L 03/05/2008 - 23:45:06: [SM] Displaying call stack trace for plugin "executeconfigs.smx":
L 03/05/2008 - 23:45:06: [SM]  [0]  Line 99, executeconfigs.sp::ExecClientsConfig()
L 03/05/2008 - 23:45:06: [SM]  [1]  Line 77, executeconfigs.sp::OnClientDisconnect()
L 03/05/2008 - 23:45:06: [SM] Native "KillTimer" reported: Invalid timer handle ea00e3 (error 3)
L 03/05/2008 - 23:45:06: [SM] Displaying call stack trace for plugin "executeconfigs.smx":
L 03/05/2008 - 23:45:06: [SM]  [0]  Line 99, executeconfigs.sp::ExecClientsConfig()
L 03/05/2008 - 23:45:06: [SM]  [1]  Line 77, executeconfigs.sp::OnClientDisconnect()
L 03/05/2008 - 23:45:06: [SM] Native "KillTimer" reported: Invalid timer handle ea00e3 (error 3)
L 03/05/2008 - 23:45:06: [SM] Displaying call stack trace for plugin "executeconfigs.smx":
L 03/05/2008 - 23:45:06: [SM]  [0]  Line 99, executeconfigs.sp::ExecClientsConfig()
L 03/05/2008 - 23:45:06: [SM]  [1]  Line 77, executeconfigs.sp::OnClientDisconnect()
L 03/05/2008 - 23:45:06: [SM] Native "KillTimer" reported: Invalid timer handle ea00e3 (error 3)
L 03/05/2008 - 23:45:06: [SM] Displaying call stack trace for plugin "executeconfigs.smx":
L 03/05/2008 - 23:45:06: [SM]  [0]  Line 99, executeconfigs.sp::ExecClientsConfig()
L 03/05/2008 - 23:45:06: [SM]  [1]  Line 77, executeconfigs.sp::OnClientDisconnect()
L 03/05/2008 - 23:45:06: [SM] Native "KillTimer" reported: Invalid timer handle ea00e3 (error 3)
L 03/05/2008 - 23:45:06: [SM] Displaying call stack trace for plugin "executeconfigs.smx":
L 03/05/2008 - 23:45:06: [SM]  [0]  Line 99, executeconfigs.sp::ExecClientsConfig()
L 03/05/2008 - 23:45:06: [SM]  [1]  Line 77, executeconfigs.sp::OnClientDisconnect()
L 03/05/2008 - 23:45:06: [SM] Native "KillTimer" reported: Invalid timer handle ea00e3 (error 3)
L 03/05/2008 - 23:45:06: [SM] Displaying call stack trace for plugin "executeconfigs.smx":
L 03/05/2008 - 23:45:06: [SM]  [0]  Line 99, executeconfigs.sp::ExecClientsConfig()
L 03/05/2008 - 23:45:06: [SM]  [1]  Line 77, executeconfigs.sp::OnClientDisconnect()
L 03/05/2008 - 23:45:06: [SM] Native "KillTimer" reported: Invalid timer handle ea00e3 (error 3)
L 03/05/2008 - 23:45:06: [SM] Displaying call stack trace for plugin "executeconfigs.smx":
L 03/05/2008 - 23:45:06: [SM]  [0]  Line 99, executeconfigs.sp::ExecClientsConfig()
L 03/05/2008 - 23:45:06: [SM]  [1]  Line 77, executeconfigs.sp::OnClientDisconnect()

executeconfigs_cfgs.txt

Code:

Configs
{
    "clients:1"    "10:welcome.cfg"
    "clients:2"    "0:8PlayersToStart.cfg"
    "clients:3"    "0:7PlayersToStart.cfg"
    "clients:4"    "0:6PlayersToStart.cfg"
    "clients:5"    "0:5PlayersToStart.cfg"
    "clients:6"    "0:4PlayersToStart.cfg"
    "clients:7"    "0:3PlayersToStart.cfg"
    "clients:8"    "0:2PlayersToStart.cfg"
    "clients:9"    "0:1PlayersToStart.cfg"
    "clients:10"    "15:mixstart.cfg"
}



All times are GMT -4. The time now is 07:36.

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