Перейти к содержимому
View in the app

A better way to browse. Learn more.

Zloplay community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Опубликовано:

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

Featured Replies

Опубликовано:
  • Автор

It's not.. I also fixed I had just forgotten to put {} above ServerSay and below ServerCommand :P I'm such a dummy xC.. And wait what plugin I never heard of it..

Ok now I have another question.. "base.\u002Ector();" a0YRL.png got any ideas? I was trying to edit Pozzuh aaaPermissionPlugin that I got from Nukem Dedicated Server Addon I'm waiting for Pozzuh's response on how to fix it. Changed the framework to 3.0 by the way

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Гость
Ответить в тему...

Сейчас на странице 0

  • Нет пользователей, просматривающих эту страницу

Важная информация

Используя этот сайт, вы соглашаетесь Условия использования.

Account

Navigation

Поиск

Поиск

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.