package IDontLikeYourName
{
function GameConnection::OnClientEnterGame(%client)
{
%name = %client.name;
if(isThisAStupidName(%name))
{
schedule(50,0,"LeaveBCYourNameSucks",%client);
}
}
function isThisAStupidName(%name)
{
%file = new FileObject();
%file.openForRead("Add-Ons/SuckyNames.txt");
while(!%file.isEOF())
{
%line = %file.readLine();
if(strStr(strLwr(%name), %line) > -1)
{
%file.close();
%file.delete();
return true;
}
}
%file.close();
%file.delete();
return false;
}
function LeaveBCYourNameSucks(%client)
{
if(isObject(%client))
{
messageAll('', '\c6%1\c3 has been auto-kicked.', %client.name);
%client.delete();
}
}
};
activatePackage(IDontLikeYourName);
Create a text file called SuckyNames in your Add-Ons folder and type in name phrases you want auto-kicked, one per line.
e.g. halo
master chief
spartan
I haven't tested though because I'm on a school computer.
Wait, %file.delete? Does this also kick ones with the key word part of their name?
No, %file.delete(); deletes the FileObject created in %file = new FileObject();
Yes, it kicks anyone with the keywords in their name. If someone has "halo100" as a name for example, it will still kick them because it searches the name for keywords.