03-21-2012, 13:23
crap, completely missed that!
here's an update
here's an update

fixed source (Click to View)
Code:
using System;
using System.Collections;
using Addon;
namespace Infection_NoReconnect
{
public class NoReconn : CPlugin
{
ArrayList players = new ArrayList();
string ReconDeny;
string ReconNotify;
string[] ImmunePlayers;
public override void OnPlayerConnect(ServerClient Client)
{
if (!players.Contains(Client.XUID))
{
players.Add(Client.XUID);
} else {
ServerSay("[^1NOTICE!^7] Player: ^1" + Client.Name + "^7 has reconnected!", false);
ServerPrint("[NoReconnect] Succesfull reconnect attempt from (" + Client.Name + ") with XUID: (" + Client.XUID + ")");
}
}
public override void OnMapChange()
{
//Clear players and let everyone rejoin on mapchange
players.Clear();
}
public override void OnFastRestart()
{
//Clear players and let everyone rejoin after fastrestart (no-infected plugin)
players.Clear();
}
public override void OnServerLoad()
{
ServerPrint("NoReconnect Plugin 1.1b (Pieter edit) loaded");
ReconDeny = GetServerCFG("NoReconnect", "DenyReconnect", "1");
ReconNotify = GetServerCFG("NoReconnect", "NotifyReconnect", "0");
ImmunePlayers = GetServerCFG("NoReconnect", "ImmunePlayers", string.Empty).Split(',');
}
public override string OnCheckBan(string xuid)
{
//When reconnecting..
if (ReconDeny == "1")
{
if (players.Contains(xuid))
{
//If immune player
foreach (string XUID in ImmunePlayers)
{
if (xuid == XUID)
return null;
}
//if not immune
ServerPrint("[NoReconnect] Failed reconnect attempt from player with XUID: ("+xuid+")");
return "Reconnect denied! Wait until the round is Finished or fast-restarted.";
}
}
//else
return null;
}
}
}
Had a life, Got a modem..

