Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Release Bad Names Kick Plugin v3.0
04-16-2012, 14:40 (This post was last modified: 04-29-2012 18:23 by OzonE.)
Post: #1
Bad Names Kick Plugin v3.0
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 )
Related links

Find all posts by this user
Add Thank You Quote this message in a reply
[-] The following 18 users say Thank You to OzonE for this post:
AboAlwe (04-22-2012), Arteq (04-16-2012), Beliy.IV (08-29-2012), DidUknowiPwn (04-22-2012), emilioxativa (01-17-2013), freezer2010 (03-31-2013), GrossKopf (04-16-2012), INTREPID (05-13-2012), itsmods.com76 (09-01-2012), javilico (07-21-2012), lexa__33 (05-04-2013), SailorMoon (04-16-2012), stasmarshall (08-28-2012), teamj3f (08-03-2012), timop33 (10-30-2012), tsyko (05-05-2012), zhp0083 (04-16-2012), 操你妈 (11-10-2012)
04-16-2012, 14:59 (This post was last modified: 04-16-2012 15:02 by SailorMoon.)
Post: #2
RE: Bad Names Kick Plugin
hm, good plugin.. also you should add counter for words. And we will know how many times people say that

Steam: jaydi2112
[Image: userbar7q.gif]
[Image: 45296.png]
[Image: 3OM7E.gif]
Visit this user's website Find all posts by this user
Add Thank You Quote this message in a reply
[-] The following 1 user says Thank You to SailorMoon for this post:
OzonE (04-16-2012)
04-16-2012, 15:09
Post: #3
RE: Bad Names Kick Plugin
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();
        }

    }
}

Find all posts by this user
Add Thank You Quote this message in a reply
[-] The following 2 users say Thank You to OzonE for this post:
AboAlwe (04-22-2012), Dark Assassin (02-01-2013)
04-16-2012, 16:04
Post: #4
RE: Bad Names Kick Plugin
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?
Related links
Find all posts by this user
Add Thank You Quote this message in a reply
04-16-2012, 16:10
Post: #5
RE: Bad Names Kick Plugin
lol yes

Steam: jaydi2112
[Image: userbar7q.gif]
[Image: 45296.png]
[Image: 3OM7E.gif]
Visit this user's website Find all posts by this user
Add Thank You Quote this message in a reply
04-16-2012, 17:14 (This post was last modified: 04-16-2012 17:49 by GrossKopf.)
Post: #6
RE: Bad Names Kick Plugin
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]
Find all posts by this user
Add Thank You Quote this message in a reply
04-16-2012, 17:15 (This post was last modified: 04-16-2012 17:16 by masterbob.)
Post: #7
RE: Bad Names Kick Plugin
Dude you just copied mine...
//Edit
Ah ok..
Find all posts by this user
Add Thank You Quote this message in a reply
[-] The following 1 user says Thank You to masterbob for this post:
OzonE (04-16-2012)
04-16-2012, 18:24
Post: #8
RE: Bad Names Kick Plugin
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.
Related links

[Image: tanksignature.jpg]
Find all posts by this user
Add Thank You Quote this message in a reply
04-16-2012, 18:51 (This post was last modified: 04-16-2012 18:53 by DidUknowiPwn.)
Post: #9
RE: Bad Names Kick Plugin
(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 | http://www.itsmods.com////
////CoD8HMod | http://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.
Find all posts by this user
Add Thank You Quote this message in a reply
04-16-2012, 19:19 (This post was last modified: 04-16-2012 19:21 by OzonE.)
Post: #10
RE: Bad Names Kick Plugin
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

Find all posts by this user
Add Thank You Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
Rainbow [Release] AmmoBox Plugin 8q4s8 13 501 06-03-2013 21:15
Last Post: X-Track
  [Release] God Plugin v4.0 [Ingame Rcon Tool] OzonE 315 39,190 06-03-2013 13:20
Last Post: SgtLegend
Star [Release] Night-Vision Plugin v1.1 X-Track 7 362 06-01-2013 22:26
Last Post: X-Track
  [Release] Bunker Plugin 1.3 archit 58 3,705 06-01-2013 22:09
Last Post: X-Track
  [Release] Chat plugin for permissions SgtLegend 9 532 06-01-2013 15:02
Last Post: SgtLegend
  [Release] Waypoint plugin for users 8q4s8 2 325 05-30-2013 21:17
Last Post: 8q4s8
  [Release] Yurio Map Plugin Yurio 96 12,509 05-29-2013 23:40
Last Post: e47
  [Release] Gamespeed plugin 8q4s8 6 268 05-28-2013 16:31
Last Post: 8q4s8
  [Release] Flag plugin for users 1.6 archit 74 5,171 05-25-2013 13:03
Last Post: archit
  [Release] For Plugin Developers yamraj 4 1,313 05-21-2013 17:55
Last Post: Jone Calerone

Forum Jump:


User(s) browsing this thread: 1 Guest(s)
Media Embeding by Simple Audio Video Embeder