Sign in to follow this  
freaker

Anti Name Change Script for server side!

Recommended Posts

There is an easy solution for such things.

just check the the player.name and save it in a variable.

check the variable with the actual player.name once in a while.

use a checksum to check if it bypassed your allowed amount.

if it does you can drop the client.

//sorry im not sure if im allowed to provide scripts on the board ( ivent read the rules yet haha )

you could contact me on xfire : evilphinal

Share this post


Link to post
Share on other sites


//__/\\\______________/\\\______________________________________________________________________________________
// _\/\\\_____________\/\\\_____________________________________________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 :P )

Share this post


Link to post
Share on other sites

Decompile your mod.ff if you do not have sources already.

Mostlikely thread it in the mod.gsc or globallogic.gsc

Not sure which filenames 2.18 uses.

Copy the script in a gsc file and thread it.

Thread scriptfoldername/scriptname::init ();

Should do your trick

Share this post


Link to post
Share on other sites

Wingzor actually I have little idea about mod editing....So, can you please edit a fresh pml218 mod for me and integrate the anti name changing script....and if possible tell me how I can use the anti name changing script as a plugin in the server without integrating it with the mod.....

Share this post


Link to post
Share on other sites
Guest arj

Offtop.


// _\/\\\_____________\/\\\_____________________________________________xfire:_Evilphinal________________________
// _\/\\\_____________\/\\\__/\\\_________________/\\\\\\\\______________________________________________________
// _\//\\\____/\\\____/\\\__\///___/\\/\\\\\\____/\\\////\\\__/\\\\\\\\\\\_____/\\\\\_____/\\/\\\\\\\____________
// __\//\\\__/\\\\\__/\\\____/\\\_\/\\\////\\\__\//\\\\\\\\\_\///////\\\/____/\\\///\\\__\/\\\/////\\\___________
// ___\//\\\/\\\/\\\/\\\____\/\\\_\/\\\__\//\\\__\///////\\\______/\\\/_____/\\\__\//\\\_\/\\\___\///____________
// ____\//\\\\\\//\\\\\_____\/\\\_\/\\\___\/\\\__/\\_____\\\____/\\\/______\//\\\__/\\\__\/\\\___________________
// _____\//\\\__\//\\\______\/\\\_\/\\\___\/\\\_\//\\\\\\\\___/\\\\\\\\\\\__\///\\\\\/___\/\\\___________________
// ______\///____\///_______\///__\///____\///___\////////___\///////////_____\/////_____\///____________________
//__/\\\______________/\\\______________________________________________________________________________________ 

That one reminds me of old configs/cheats for games and trainers,with 8-bit music. I loved it :D

Share this post


Link to post
Share on other sites

Can you tell me how I can learn the basic of gsc and fix this script and also make some scripts of my own??? I have added you on xfire...you can also give me little training on gsc scripting and cod4 modding.....

Share this post


Link to post
Share on other sites

Can you tell me how I can learn the basic of gsc and fix this script and also make some scripts of my own??? I have added you on xfire...you can also give me little training on gsc scripting and cod4 modding.....

Oh dude...

You said you are a webmaster, thus you must have a fair bit of experience writing code. So, just open up some map or mod gsc scripts and learn cod4 script functions(?). If you learn to use search engines, your problem is solved.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this