The idea: Plugin that adds the !apb (username) command (aka Add Player Ban or All Points Bulletin). Upon issuing that command, the playername, as it is typed after the command, is entered into a text file. Whenever someone joins the server, their name is checked against the file and they are banned, temp banned or kicked, according to the settings in the config file if they are in that list. This would also allow server admins to manually edit the list on the server if they have access to it.
Purpose: Mainly so you can create a "ban names" list, either of offensive names or names of players known to be problems.
Other: I know that a player can easily change their name to avoid this, but if they don't know they are on the list, they won't change their name.
Hopefully one of you expert programmers out there can come up with something!
(04-09-2012, 19:29)GrossKopf Wrote: [ -> ]Hopefully one of you expert programmers out there can come up with something!
@
Nukem or @
SuperNovaAO please...
Im sure the forum will help you, sadly i dont know sh1t about this.
Thanks Barata...
Same here, go ask senior @
JariZ
I'm sorry but I refuse to look into this teknogods stuff.
(04-09-2012, 20:48)JariZ Wrote: [ -> ]I'm sorry but I refuse to look into this teknogods stuff.
This is something that is of use to regular MW3 and Teknogods and doesn't require any special knowledge of Teknogods MW3. It's purpose is to kick, tempban or permban someone based on their name and that is all.
Banning people on their name won't work and is resolved with a simple name change, why do you think we have XUID's in the first place?
(04-09-2012, 21:12)JariZ Wrote: [ -> ]Banning people on their name won't work and is resolved with a simple name change, why do you think we have XUID's in the first place?
I don't think you understand. I'm not looking for a way to ban someone by their name.
As he said: he wants to automatically ban people based on their name, not their attitude.
So you automatically kick/ban all "Hitler"'s, all "Unnamed Soldier"'s etc
The banning would then be by XUID obviously.
(04-09-2012, 22:31)SuperNovaAO Wrote: [ -> ]As he said: he wants to automatically ban people based on their name, not their attitude.
So you automatically kick/ban all "Hitler"'s, all "Unnamed Soldier"'s etc
The banning would then be by XUID obviously.
Yup. Exactly. Thought I took long enough to compose that post so as not to confuse people.
PHP Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using Addon;
namespace ClassLibrary1
{
public class Class1 : CPlugin
{
string file = "forbidden.txt";//located in the call of duty modern warfare 3 folder
List<string> fwords = new List<string>();
public override void OnServerLoad()
{
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))
ServerCommand("kick \"" + Client.Name+ "\" + HOMO");
}
}
public override ChatType OnSay(string Message, ServerClient Client)
{
string[] msg = Message.Split(' ');
try
{
if (msg[0] == "!add" && !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 + " 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) //http://www.tsql.de/csharp/csharp_textdatei
{
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) //http://www.tsql.de/csharp/csharp_textdatei
{
StreamWriter myFile = new StreamWriter(sFilename);
myFile.Write(sLines);
myFile.Close();
}
}
}
I hope this is what you needed. It should work