Featured Replies
Сейчас на странице 0
- Нет пользователей, просматривающих эту страницу
A better way to browse. Learn more.
A full-screen app on your home screen with push notifications, badges and more.
Используя этот сайт, вы соглашаетесь Условия использования.
using System; using System.Collections.Generic; using System.Text; using System.IO; using Addon; namespace ClassLibrary1 { public class Class1 : CPlugin { string file = "forbidden.txt"; List fwords = new List(); public override void OnServerLoad() { ServerPrint("BadNames Plugin By OzonE -fixed by DidUknowiPwn Loaded!"); try { ServerPrint("Forbidden Names: "); refreshwords(); } catch { ServerPrint(file + " not found"); } } public override void OnPlayerConnect(ServerClient Client) { string[] cn = Client.Name.Split(' '); foreach (string x in cn) { if (fwords.Contains(x)) ServerSay("^1Prevented connection of a ^5Badnamed player!", true); ServerCommand("kickclient " + Client.ClientNum); } } public override ChatType OnSay(string Message, ServerClient Client) { string[] msg = Message.Split(' '); try { if (msg[0] == "!plus" && !fwords.Contains(msg[1])) { string old = ReadFile(file); WriteFile(file, old + " " + msg[1]); TellClient(Client.ClientNum, msg[1] + " added.", true); refreshwords(); return ChatType.ChatNone; } if (msg[0] == "!show") printwords(); } catch { ServerSay(file + " File Is Not Found", true); } return ChatType.ChatAll; } void refreshwords() { try { string[] words = ReadFile(file).Split(' '); foreach (string x in words) { ServerPrint(x + "\n"); fwords.Add(x); } } catch { ServerPrint(file + " Not Found"); } } void printwords() { ServerSay("Forbidden Names: ", true); foreach (string x in fwords) { ServerSay(x, true); } } public string ReadFile(String sFilename) // { string sContent = ""; if (File.Exists(sFilename)) { StreamReader myFile = new StreamReader(sFilename, System.Text.Encoding.Default); sContent = myFile.ReadToEnd(); myFile.Close(); } return sContent; } public void WriteFile(String sFilename, String sLines) { StreamWriter myFile = new StreamWriter(sFilename); myFile.Write(sLines); myFile.Close(); } } }Guys I need some help coding a plugin for MW3.. see what this plugin does is that it kicks a player based on their name. I will change the kickclient to banclient later on once this plugin is functioning correctly.. the issue I'm having now is that it kicks ANYONE that joins the server I don't know why.. If you have any help please tell me