Posts: 502
Threads: 13
Joined: Feb 2012
Reputation:
42
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.
Had a life, Got a modem..
Posts: 502
Threads: 13
Joined: Feb 2012
Reputation:
42
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!
Had a life, Got a modem..
Posts: 502
Threads: 13
Joined: Feb 2012
Reputation:
42
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
InfectedRestarter_v7b.zip (Size: 3.04 KB / Downloads: 23)
Had a life, Got a modem..
Posts: 502
Threads: 13
Joined: Feb 2012
Reputation:
42
@
LS_ARRoW Does this version work to satisfaction?
Had a life, Got a modem..
Posts: 502
Threads: 13
Joined: Feb 2012
Reputation:
42
yes that is the timeout i put in to avoid restarts before the infected has been chosen
Had a life, Got a modem..