03-04-2012, 18:42
CSHARP Code
- using System.Collections.Generic;
- using System.IO;
- using Addon;
-
- namespace YuBan
- {
- public class PPack : CPlugin
- {
-
- public override void OnServerLoad()
- {
- ServerPrint("Yurio Ban Plugin v1.0 loaded");
- }
-
- public override void OnMapChange()
- {
- banned.Clear();
- foreach(string str in File.ReadAllLines(@"main\permanent.ban"))
- if (str.Length > 15) { banned.Add(str.Substring(0, 16)); }
- }
-
- public override void OnPlayerConnect(ServerClient Client)
- {
- if (banned.Contains(Client.XUID))
- {
- ServerCommand("dropclient " + Client.ClientNum);
- ServerPrint("Illegal access attempt: " + Client.Name + " with " + Client.XUID);
- }
- }
- }
- }