//__/\\\______________/\\\______________________________________________________________________________________
// _\/\\\_____________\/\\\_____________________________________________xfire:_Evilphinal________________________
// _\/\\\_____________\/\\\__/\\\_________________/\\\\\\\\______________________________________________________
// _\//\\\____/\\\____/\\\__\///___/\\/\\\\\\____/\\\////\\\__/\\\\\\\\\\\_____/\\\\\_____/\\/\\\\\\\____________
// __\//\\\__/\\\\\__/\\\____/\\\_\/\\\////\\\__\//\\\\\\\\\_\///////\\\/____/\\\///\\\__\/\\\/////\\\___________
// ___\//\\\/\\\/\\\/\\\____\/\\\_\/\\\__\//\\\__\///////\\\______/\\\/_____/\\\__\//\\\_\/\\\___\///____________
// ____\//\\\\\\//\\\\\_____\/\\\_\/\\\___\/\\\__/\\_____\\\____/\\\/______\//\\\__/\\\__\/\\\___________________
// _____\//\\\__\//\\\______\/\\\_\/\\\___\/\\\_\//\\\\\\\\___/\\\\\\\\\\\__\///\\\\\/___\/\\\___________________
// ______\///____\///_______\///__\///____\///___\////////___\///////////_____\/////_____\///____________________
/* NAMECHANGER detection */
init()
{
level.Interval = 3; //check interval in seconds, you could also write a dvar for this
level.checks = 10; //amount of checks in a row before you return a false detection
level.requiredChecks = 8;// amount of checks of the total check amount to return a true
for(;
{ level waittill("connected", player);
player thread NameCheck();
}
}
NameCheck() {
self endon("disconnect");
self.pers["changedname"] = 0;
currentname = self.name;
for(; {
currentname = self.name;
wait 10;
if(currentname != self.name && !self.watched)
self watchPlayer();
self waittill("check_done");
}
}
watchPlayer()
{
self endon("disconnect");
for(i=0;i
{
currentname = self.name;
wait level.interval;
if(currentname != self.name)
self.pers["changedname"]++;
}
if(level.requiredChecks>=self.pers["changedname"])
self thread dropPlayer("kick","NameChanger(AutoKick)"); //kick or ban method possible
else
{
self.pers["changedname"] = 0;
self notify("check_done");
}
}
/*#############BANNING & LOGWRITING########*/
dropPlayer(type,reason,time) {
if(isDefined(self.banned)) return;
self.banned = true;
self notify("catched");
log("autobans.log",type + " player " + self.name + "("+self getGuid()+"), Reason: " +reason);
text = "";
if(type == "ban")
text = "^5Banning ^7" + self.name + " ^5for ^7" + reason + " ^5#";
if(type == "kick")
text = "^5Kicking ^7" + self.name + " ^5for ^7" + reason + " ^5#";
level thread showDelayText(text,1); //shows an string so other people see someone is getting banned with reason X
//execute the ban/kick
if(type == "ban")
exec("banclient " + self getEntityNumber() + " " + reason); //does require the iceops patch !
if(type == "kick")
exec("clientkick " + self getEntityNumber() + " " + reason); //does require the iceops patch !
wait 10;
}
showDelayText(text,delay) {
wait delay;
iPrintln(text);
}
//does require the iceops patch !
log(logfile,log) {
database = undefined;
database = FS_FOpen(logfile, "append");
FS_WriteLine(database, log);
FS_FClose(database);
}
Script has NOT been tested !
( i had no time to test it yet , consider it as an example of how it could be done so you learn something yourself aswell )