Results 1 to 10 of 15

Thread: Anti-Cheat Solution for COD2 1.0?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Private CaptainSlow's Avatar
    Join Date
    Nov 2014
    Posts
    76
    Thanks
    38
    Thanked 28 Times in 23 Posts
    Quote Originally Posted by filthy_freak_ View Post
    Here is a script I made for detecting name changers;
    Thank you very much for the script! I'm not using libcod as I'm running Windows, but I can still use the first script, right?
    If so, how do I install it? Which file do I need to alter/create? Sorry for asking, first time I install a script.

    Thanks!

  2. #2
    Private First Class
    Join Date
    Oct 2013
    Posts
    219
    Thanks
    56
    Thanked 105 Times in 66 Posts
    Quote Originally Posted by CaptainSlow View Post
    Thank you very much for the script! I'm not using libcod as I'm running Windows, but I can still use the first script, right?
    If so, how do I install it? Which file do I need to alter/create? Sorry for asking, first time I install a script.

    Thanks!
    Put the antiCheat() method in your gametype.gsc file and call self thread antiCheat(); on connect.

  3. The Following User Says Thank You to filthy_freak_ For This Useful Post:

    CaptainSlow (12th September 2015)

  4. #3
    Private CaptainSlow's Avatar
    Join Date
    Nov 2014
    Posts
    76
    Thanks
    38
    Thanked 28 Times in 23 Posts
    Quote Originally Posted by filthy_freak_ View Post
    Put the antiCheat() method in your gametype.gsc file and call self thread antiCheat(); on connect.
    Thanks for your reply. I'm really sorry but I do not have a file named gametype.gsc in my COD2 folder. Do I need to create it myself like in this picture?
    http://killtube.org/showthread.php?1...ull=1#post9897

    Many thanks!

  5. #4
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    Quote Originally Posted by CaptainSlow View Post
    Thanks for your reply. I'm really sorry but I do not have a file named gametype.gsc in my COD2 folder. Do I need to create it myself like in this picture?
    http://killtube.org/showthread.php?1...ull=1#post9897

    Many thanks!
    There is no 'gametype.gsc', what he meant is '<name-of-the-gametype-here>.gsc'.
    Gametypes are (theyre listed also in the serverbrowser)
    tdm, dm, sd, ctf, hq and custom ones like zom, zombot, koth etc.

    These files are in the iw_**.iwd containers (which are simple zip containers that you can open with winzip or 7zip).
    Iirc in the iw_7.iwd there is the maps/mp/gametypes folder where all the gametypes are listed.
    If you run a mod, then its likely that there is a zzz_svr_your-mod-name.iwd, (or the mod is not in an container), however the directorystructure is the same.
    If you do not have a mod installed, tell us (so you have to create one on your own, which is simply some copy n paste of the iw_7.iwd and renaming it, as you should not modify the original game-files)

    In the gametypes.gsc there is usually on the top some setup going on in the main() function.
    This function calls Callback_StartGameType() and this may call an onPlayerConnect() etc. function, this is the place where you have to add the onCheat() function.

  6. The Following User Says Thank You to serthy For This Useful Post:

    CaptainSlow (13th September 2015)

  7. #5
    Private CaptainSlow's Avatar
    Join Date
    Nov 2014
    Posts
    76
    Thanks
    38
    Thanked 28 Times in 23 Posts
    Quote Originally Posted by serthy View Post
    There is no 'gametype.gsc', what he meant is '<name-of-the-gametype-here>.gsc'.
    Gametypes are (theyre listed also in the serverbrowser)
    tdm, dm, sd, ctf, hq and custom ones like zom, zombot, koth etc.

    These files are in the iw_**.iwd containers (which are simple zip containers that you can open with winzip or 7zip).
    Iirc in the iw_7.iwd there is the maps/mp/gametypes folder where all the gametypes are listed.
    If you run a mod, then its likely that there is a zzz_svr_your-mod-name.iwd, (or the mod is not in an container), however the directorystructure is the same.
    If you do not have a mod installed, tell us (so you have to create one on your own, which is simply some copy n paste of the iw_7.iwd and renaming it, as you should not modify the original game-files)

    In the gametypes.gsc there is usually on the top some setup going on in the main() function.
    This function calls Callback_StartGameType() and this may call an onPlayerConnect() etc. function, this is the place where you have to add the onCheat() function.
    Thank you very much for your detailed answer, I appreciate it!

    I'm indeed not running any mods. So I copied the IW_7.iwd file, extracted it using 7zip, went to the maps/mp/gametypes folder and opened (for instance) tdm.gsc with Notepad++.
    I can see the Main() function and the Callback_StartGameType() and onPlayerConnect() function, but now my question is: Where exactly do I paste the onCheat() code? In the main()?

    Code:
    main()
    {
    	level.callbackStartGameType = ::Callback_StartGameType;
    	level.callbackPlayerConnect = ::Callback_PlayerConnect;
    	level.callbackPlayerDisconnect = ::Callback_PlayerDisconnect;
    	level.callbackPlayerDamage = ::Callback_PlayerDamage;
    	level.callbackPlayerKilled = ::Callback_PlayerKilled;
    	maps\mp\gametypes\_callbacksetup::SetupCallbacks();
    
    	level.autoassign = ::menuAutoAssign;
    	level.allies = ::menuAllies;
    	level.axis = ::menuAxis;
    	level.spectator = ::menuSpectator;
    	level.weapon = ::menuWeapon;
    	level.endgameconfirmed = ::endMap;
    }
    
    Callback_StartGameType()
    {
    	level.splitscreen = isSplitScreen();
    
    	// defaults if not defined in level script
    	if(!isDefined(game["allies"]))
    		game["allies"] = "american";
    	if(!isDefined(game["axis"]))
    		game["axis"] = "german";
    
    	// server cvar overrides
    	if(getCvar("scr_allies") != "")
    		game["allies"] = getCvar("scr_allies");
    	if(getCvar("scr_axis") != "")
    		game["axis"] = getCvar("scr_axis");
    
    	precacheStatusIcon("hud_status_dead");
    	precacheStatusIcon("hud_status_connecting");
    	precacheRumble("damage_heavy");
    	precacheString(&"PLATFORM_PRESS_TO_SPAWN");
    
    	thread maps\mp\gametypes\_menus::init();
    	thread maps\mp\gametypes\_serversettings::init();
    	thread maps\mp\gametypes\_clientids::init();
    	thread maps\mp\gametypes\_teams::init();
    	thread maps\mp\gametypes\_weapons::init();
    	thread maps\mp\gametypes\_scoreboard::init();
    	thread maps\mp\gametypes\_killcam::init();
    	thread maps\mp\gametypes\_shellshock::init();
    	thread maps\mp\gametypes\_hud_teamscore::init();
    	thread maps\mp\gametypes\_deathicons::init();
    	thread maps\mp\gametypes\_damagefeedback::init();
    	thread maps\mp\gametypes\_healthoverlay::init();
    	thread maps\mp\gametypes\_friendicons::init();
    	thread maps\mp\gametypes\_spectating::init();
    	thread maps\mp\gametypes\_grenadeindicators::init();
    
    	level.xenon = (getcvar("xenonGame") == "true");
    	if(level.xenon) // Xenon only
    		thread maps\mp\gametypes\_richpresence::init();
    	else // PC only
    		thread maps\mp\gametypes\_quickmessages::init();
    
    	setClientNameMode("auto_change");
    
    	spawnpointname = "mp_tdm_spawn";
    	spawnpoints = getentarray(spawnpointname, "classname");
    
    	if(!spawnpoints.size)
    	{
    		maps\mp\gametypes\_callbacksetup::AbortLevel();
    		return;
    	}
    
    	for(i = 0; i < spawnpoints.size; i++)
    		spawnpoints[i] placeSpawnpoint();
    
    	allowed[0] = "tdm";
    	maps\mp\gametypes\_gameobjects::main(allowed);
    
    	// Time limit per map
    	if(getCvar("scr_tdm_timelimit") == "")
    		setCvar("scr_tdm_timelimit", "30");
    	else if(getCvarFloat("scr_tdm_timelimit") > 1440)
    		setCvar("scr_tdm_timelimit", "1440");
    	level.timelimit = getCvarFloat("scr_tdm_timelimit");
    	setCvar("ui_tdm_timelimit", level.timelimit);
    	makeCvarServerInfo("ui_tdm_timelimit", "30");
    
    	// Score limit per map
    	if(getCvar("scr_tdm_scorelimit") == "")
    		setCvar("scr_tdm_scorelimit", "300");
    	level.scorelimit = getCvarInt("scr_tdm_scorelimit");
    	setCvar("ui_tdm_scorelimit", level.scorelimit);
    	makeCvarServerInfo("ui_tdm_scorelimit", "300");
    
    	// Force respawning
    	if(getCvar("scr_forcerespawn") == "")
    		setCvar("scr_forcerespawn", "0");
    
    	if(!isDefined(game["state"]))
    		game["state"] = "playing";
    
    	level.mapended = false;
    
    	level.team["allies"] = 0;
    	level.team["axis"] = 0;
    
    	thread startGame();
    	thread updateGametypeCvars();
    	//thread maps\mp\gametypes\_teams::addTestClients();
    }
    
    dummy()
    {
    	waittillframeend;
    
    	if(isdefined(self))
    		level notify("connecting", self);
    }
    
    Callback_PlayerConnect()
    {
    	thread dummy();
    
    	self.statusicon = "hud_status_connecting";
    	self waittill("begin");
    	self.statusicon = "";
    
    	level notify("connected", self);
    
    	if(!level.splitscreen)
    		iprintln(&"MP_CONNECTED", self);
    
    	lpselfnum = self getEntityNumber();
    	lpGuid = self getGuid();
    	logPrint("J;" + lpGuid + ";" + lpselfnum + ";" + self.name + "\n");
    
    	if(game["state"] == "intermission")
    	{
    		spawnIntermission();
    		return;
    	}
    
    	level endon("intermission");
    
    	if(level.splitscreen)
    		scriptMainMenu = game["menu_ingame_spectator"];
    	else
    		scriptMainMenu = game["menu_ingame"];
    
    	if(isDefined(self.pers["team"]) && self.pers["team"] != "spectator")
    	{
    		self setClientCvar("ui_allow_weaponchange", "1");
    
    		if(self.pers["team"] == "allies")
    			self.sessionteam = "allies";
    		else
    			self.sessionteam = "axis";
    
    		if(isDefined(self.pers["weapon"]))
    			spawnPlayer();
    		else
    		{
    			spawnSpectator();
    
    			if(self.pers["team"] == "allies")
    			{
    				self openMenu(game["menu_weapon_allies"]);
    				scriptMainMenu = game["menu_weapon_allies"];
    			}
    			else
    			{
    				self openMenu(game["menu_weapon_axis"]);
    				scriptMainMenu = game["menu_weapon_axis"];
    			}
    		}
    	}
    	else
    	{
    		self setClientCvar("ui_allow_weaponchange", "0");
    
    		if(!isDefined(self.pers["skipserverinfo"]))
    			self openMenu(game["menu_team"]);
    
    		self.pers["team"] = "spectator";
    		self.sessionteam = "spectator";
    
    		spawnSpectator();
    	}
    
    	self setClientCvar("g_scriptMainMenu", scriptMainMenu);
    }
    Also, since I'm not running a modded server at the moment, I assume I need to run the server with mods now to have this function properly?

    Many thanks!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •