Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Release Bad Names Kick Plugin v3.0
#1
This Version Now Works Perfect.

This Is The Plugin That you can kick Clients With Badnames or etc
(you can add clan tags to ban a whole fleet from your server Troll )

You Have To create a file in root folder named "forbidden.txt"
Add the names To it.
you can add names ingame too, but you cannot remove it ingame.
but you can remove anyword anytime , server reads it again.


"!badname <badname>" - adds a badname
"!show" - shows the list of badnames

this works perfectly fine , thanks to @masterbob


Version 3.0 Fixed By @DidUknowiPwn , Thanks Buddy. (i did not have time to do the shit so he did it Like a sir )
Reply

#2
hm, good plugin.. also you should add counter for words. And we will know how many times people say that
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#3
Want Source? Big Grin
Here:
Code:
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<string> fwords = new List<string>();
        public override void OnServerLoad()
        {
            ServerPrint("BadNames Plugin By OzonE 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("^7BadName Plugin ^1Prevented Connection of A ^5Badname Player!", true);
                ServerCommand("kick " + Client.ClientNum + "\"  Bad Name, ^1Fuck Off!\"");
            }        
        
}


        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();
        }

    }
}
Reply

#4
Our clan 3rd. Sometimes players go to the server with the our clan tag. If I add "3rd" in the file forbidden.txt - admin with nick 3rd kicks, too?
Reply

#5
lol yes
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#6
Any chance you could add an option to ban instead of kick?

*edit* Nevermind. I used the guide to compile plugins and i just changed the kick to ban. Going to test it now.
[Image: tanksignature.jpg]
Reply

#7
Dude you just copied mine...
//Edit
Ah ok..
Reply

#8
This isn't working for me. Can anyone confirm that it's working? It's as if the plugin isn't even loading. !badadd doesn't do anything. forbidden.txt is in my root server folder.
[Image: tanksignature.jpg]
Reply

#9
(04-16-2012, 18:24)GrossKopf Wrote: This isn't working for me. Can anyone confirm that it's working? It's as if the plugin isn't even loading. !badadd doesn't do anything. forbidden.txt is in my root server folder.

I can also confirm it's not loading as well.
Quote://////////////////////////////////////////
//////Dedicated server addon enabled//////
////Created by Nukem | www.itsmods.com////
////CoD8HMod | www.cod6hmod.itshax.com////
//////////////////////////////////////////

Version 1.204
Permission plugin loaded. Author: Pozzuh. Version 1.0 Beta
BadNames Plugin By OzonE Loaded!
Forbidden Names:


God Plugin By OzonE. Version 1.01
thanks to Bonemind And JariZ
ohai. Rules v2 loaded
Bonemind's ingame RCON v0.7.0 BETA loaded
You have an error in the aliases file, ignoring line:!say = !rcon say
Server timed messages successfully loaded!
that's as far as any plugin loads..

EDIT: tried !badadd before didn't show anything but just tried !show and it worked..
Tried it again.. using !badadd not working doesn't do anything.
Reply

#10
not loading? so whats the server print mark?
add words to forbidden.txt in Lines
like this :
Derp
Derpina

Maybe when you changed the code you messed something up
also , i saw youre using godplugin and bonemind's plugin , use one of them, remove Serveradmin.dll from your plugins folder
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
Wink Plugin with !ban !kick and !tampban clemi555 3 4,168 11-09-2013, 09:21
Last Post: clemi555
  AntiNoScope Plugin clemi555 5 4,748 11-08-2013, 19:13
Last Post: clemi555
  [Release] Bunker Plugin 1.3 archit 68 41,572 10-30-2013, 11:59
Last Post: clacki
  Help Modifying plugin maverigh 5 5,671 10-19-2013, 10:29
Last Post: Nekochan
Shocked [Request] Switch plugin axel-le-meilleur 6 5,179 10-19-2013, 06:59
Last Post: iRoNinja
  [Request] Anoying and bad names kicker! Misterio 1 2,477 10-15-2013, 09:41
Last Post: Nekochan
  [Release] Yurio Map Plugin Yurio 101 62,306 09-26-2013, 13:38
Last Post: First_Semyon
Brick [Release] v1.1 ChangeMap/NextMap Plugin without any configuration milchshake 23 18,648 09-23-2013, 13:18
Last Post: SgtLegend
  Help !say Plugin (like the !say from GodPlugin) Hallla 0 2,712 09-13-2013, 09:31
Last Post: Hallla
Rainbow [Release] MW3: Random Weapon Plugin V1 Nekochan 50 33,291 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.