AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   Reload a plugin every X seconds (https://forums.alliedmods.net/showthread.php?t=338956)

Toranks 08-05-2022 18:47

Reload a plugin every X seconds
 
There is a plugin that usually stop functioning for one player and the only solution I know of is to reload it. Every five minutes would be fine, but I only know how to do it manually when a player tells me it's failing to him. I want to automate it, how can I do it?

Marttt 08-05-2022 22:57

Re: Reload a plugin every X seconds
 
better focus in fixing the issue

Toranks 08-07-2022 23:26

Re: Reload a plugin every X seconds
 
Quote:

Originally Posted by Marttt (Post 2785691)
better focus in fixing the issue

If Silvers can't, even less so, I have no idea...

https://forums.alliedmods.net/showpo...&postcount=127

Silvers 08-08-2022 04:01

Re: Reload a plugin every X seconds
 
With such old code and syntax, variables named that's confusing, my eyes started to bleed. Would be better to re-write the plugin since that one has a severe lack of optimization and convoluted methods.

Marttt 08-08-2022 12:17

Re: Reload a plugin every X seconds
 
If you want this "fixed" try finding where is the issue and then ask for help, giving more technical and detailed info.

Requesting someone (that isn't even the author) to read 1800+ lines of code + old syntax and fix it for you, and for free, it's too lazy.

band-aid fixes usually only bring more issues than fixes.

Try removing (set to 0 or a bigger value) any fatigues changing the cvars belows:

Code:

z_gun_swing_coop_max_penalty            : 8        : , "rep", "cl", "launcher" : **The number of swings before the maximum punch/melee/shove fatigue delay is set in (coop).
z_gun_swing_coop_min_penalty            : 5        : , "rep", "cl", "launcher" : **The number of swings before the minimum punch/melee/shove fatigue delay is set in (coop).
z_gun_swing_vs_max_penalty              : 6        : , "rep", "cl", "launcher" : **The number of swings before the maximum punch/melee/shove fatigue delay is set in (vs).
z_gun_swing_vs_min_penalty              : 3        : , "rep", "cl", "launcher" : **The number of swings before the minimum punch/melee/shove fatigue delay is set in (vs).

Looking at the plugin code there is nothing messing with fatigue netprop (m_iShovePenalty) from clients so I don't know if it was implemented properly

Toranks 08-09-2022 03:09

Re: Reload a plugin every X seconds
 
Quote:

Originally Posted by Marttt (Post 2785865)
If you want this "fixed" try finding where is the issue and then ask for help, giving more technical and detailed info.

Requesting someone (that isn't even the author) to read 1800+ lines of code + old syntax and fix it for you, and for free, it's too lazy.

Hey, I didn't request anything, I already tried it on my own. Silvers volunteered upon seeing the post, not at my request.
And you have explained well the reasons why I find it much more comfortable to reload the plugin from time to time than to fix it directly, since it is a rare error, approximately once every hour.

Franc1sco 08-09-2022 06:28

Re: Reload a plugin every X seconds
 
Hello, for reload the plugin this should works
PHP Code:

#include <sourcemod>

#define TIMER_INTERVAL 300.0
#define PLUGIN_NAME "l4d2_meleemod2.2.1"

public void OnPluginStart()
{
    
CreateTimer(TIMER_INTERVALTimer_Reload_TIMER_REPEAT);
}

public 
Action Timer_Reload(Handle timer)
{
    
ServerCommand("sm plugins reload %s"PLUGIN_NAME);


You can change the define values and compile here.

Toranks 08-11-2022 05:07

Re: Reload a plugin every X seconds
 
Quote:

Originally Posted by Franc1sco (Post 2785961)
Hello, for reload the plugin this should works
PHP Code:

#include <sourcemod>

#define TIMER_INTERVAL 300.0
#define PLUGIN_NAME "l4d2_meleemod2.2.1"

public void OnPluginStart()
{
    
CreateTimer(TIMER_INTERVALTimer_Reload_TIMER_REPEAT);
}

public 
Action Timer_Reload(Handle timer)
{
    
ServerCommand("sm plugins reload %s"PLUGIN_NAME);


You can change the define values and compile here.

Thanks!
Trying to find some plugin that activates fatigue for melee during further extensive searching, I couldn't find anything.
This will do the job in the meantime.

Tonblader 08-11-2022 17:03

Re: Reload a plugin every X seconds
 
Quote:

Originally Posted by Toranks (Post 2786182)
Thanks!
Trying to find some plugin that activates fatigue for melee during further extensive searching, I couldn't find anything.
This will do the job in the meantime.

Since you are still looking for something, you could use this plugin ( [Any] Delay Command ) and load automatically via a cfg file infinite times.
I explain:
create a file for example: automatic.cfg
put it in: Steam\SteamApps\common\Left 4 Dead 2\left4dead2\cfg
inside it, type these commands:
PHP Code:

sm_delaycmd_rcon 300 exec automatic.cfg //this repeat infinitely every 5 minutes with this command
whrite you commands here 

and finally in your server.cfg (dedicated server) or listenserver.cfg (listening server), add this command so that it is executed 1 time when you start the game:
PHP Code:

exec automatic.cfg 



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

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