im in start server 01.01 leave from server and rejoin wait few minuts but don't restart
we test in 01.28 kuracjusz left and rejoin but inf don't restart
Edit by @
Nukem:
Pastebin link to log
like i said before, logs dont tell me anything, i have removed it because there is absolutely no reason for it not to work.
It only does a fast restart, if the zombie that left, was the LAST zombie, and the game has been running for more then 45 seconds if that doesnt happen let me know.
Good day. if you will be have time please add me on steam LS_ARRoW or xifire: LSARRoW
i show you this problem in server
that will be kinda hard since steam is on my cellphone and it cant run MW3
I've got my servers back online so ill be able to test this soon!
CSHARP Code
using System;
using Addon;
namespace InfRestart
{
public class InfRestart : CPlugin
{
public int FramesRun = 0;
public override void OnServerLoad()
{
ServerPrint("Inf-Restarter(V7b) (by: Pieter [idea/help:JariZ,zxz0O0] <a href="http://www.itsmods.com" target="_blank" rel="noopener" class="mycode_url">www.itsmods.com</a>)");
}
public override void OnFastRestart()
{
FramesRun = 0;
}
public override void OnMapChange()
{
OnFastRestart();
}
public override void OnPlayerDisconnect(ServerClient Client)
{
if (FramesRun > 180)
{
String DVg_gametype = GetDvar("g_gametype");
String DCpname = Client.Name;
String DCpXUID = Client.XUID;
if (DVg_gametype == "infect")
{
ServerPrint("[InfRestarter] OnDisconnect triggerred Player<img src="https://www.itsmods.com/forum/images/smilies/sad.gif" alt="Sad" title="Sad" class="smilie smilie_8" />" + DCpname + ") XUID<img src="https://www.itsmods.com/forum/images/smilies/sad.gif" alt="Sad" title="Sad" class="smilie smilie_8" />" + DCpXUID + ")");
irth();
}
else
{
ServerPrint("[InfRestarter] OnDisconnect triggerred, but restarter doesnt seem to care :likeaboss:");
}
}
}
public override void OnAddonFrame()
{
FramesRun++;
}
void irth()
{
int axis = 0;
int allies = 0;
foreach (ServerClient client in GetClients())
{
if (client.Team == Teams.Allies)
{
allies++;
}
else if (client.Team == Teams.Axis)
{
axis++;
}
}
ServerPrint("[InfRestart] Determining the need to restart (Allies:"+ allies +" - Axis:"+ axis +")");
if (axis < 1)
{
ServerCommand("fast_restart");
ServerSay("[^1Infected-Restart^7] Last ^2Infected^7 left! Server did: ^2fast_restart^7! ^2Goodluck!", true);
ServerPrint("[InfRestart] Fast_restart triggerred: (Allies:" + allies + " - Axis:" + axis + ")");
}
}
}
}
Try this one, it triggers quicker and writes some debug info again
Should work now!
Download: InfRestarter V7b
[
attachment=1959]
@
LS_ARRoW Does this version work to satisfaction?
(04-26-2012, 16:05)pieter Wrote: [ -> ]@LS_ARRoW Does this version work to satisfaction?
only problem i found is that if the initial infected leaves straight away it doesn't trigger.
yes that is the timeout i put in to avoid restarts before the infected has been chosen