Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › MultiPlayer Game Hacks & Cheats › Call of Duty Hacks & Cheats › Call of Duty 6 - Modern Warfare 2 (MW2) Hacks › Call of Duty Modern Warfare 2 Server / GSC Modding › Call of Duty Modern Warfare 2 GSC Modding Help/Discussion › scripts needed

scripts needed

Posts 1–14 of 14 · Page 1 of 1
phantom1151
phantom1151
scripts needed
ok there is a script that i need for my version of gungame. it has been give to me before but did not work so please before you give my the code see if it work. also i am putting all scripts in the _rank.gsc if it needs to go somewhere else please let me know where that file can be located or if you could put that full fills code on here and i will create it that would be fine to. sorry for being noob but i am still learning the scripting. if you are willing to explain how th script works that you send me that would be cool as well but im not saying you have to thanks in advanced.
#1 · 15y ago
Fallen Souls
Fallen Souls
What? Could you explain your problem a bit clearer so I can maybe help you.
#2 · 15y ago
phantom1151
phantom1151
i need the codes/scripted needed to not allow people to camp for more then a certain time. i have been given a code in the past to do so but it did not work so im just asking to make sure its a working code that is all
#3 · 15y ago
justas1234
justas1234
Ok Heres A Anti Camp script i found in one of the mods.

Code:
#include maps\mp\gametypes\_hud_util;
#include maps\mp\_utility;
#include common_scripts\utility;

antiAFK()
{
	for(;;)
	{
			self.before = self getorigin();
			wait 4;
			self.after = self getorigin();
			if( ( distance(self.before, self.after) < 50) )
			{
				self iPrintlnBold("You have been killed for camping");
				self.health = int(self.health / 2);
			}
			if (self.health == 1)
				self suicide();
	}
}


put this in : \maps\mp\Mods\_AntiCamp.Gsc

Press Thanks If I Helped!
#4 · edited 15y ago · 15y ago
Fallen Souls
Fallen Souls
You could put this in missions or rank

and add "self thread antiAFK();" to onplayerspawned()

if you add self endon("disconnect"); to the script
#5 · 15y ago
justas1234
justas1234
Oh, My Fail
#6 · 15y ago
phantom1151
phantom1151
i dont completely understand what you mean by adding it could you show me fallen so i understand what u are saying. just trying to learn
#7 · 15y ago
Fallen Souls
Fallen Souls
add this anywhere

Code:
antiAFK()
{
    for(;;)
    {
            self endon("disconnect");
            self.before = self getorigin();
            wait 4;
            self.after = self getorigin();
            if( ( distance(self.before, self.after) < 50) )
            {
                self iPrintlnBold("You have been killed for camping");
                self.health = int(self.health / 2);
            }
            if (self.health == 1)
                self suicide();
    }
}

Then add "self thread antiAFK();" to onplayerspawned()

see if it works if it don't try without self endon("disconnect");
#8 · 15y ago
phantom1151
phantom1151
is the onplayerspawned in the rank.gsc file somewhere?
#9 · 15y ago
justas1234
justas1234
Yes, Its Caled onplayerspawned()
put the self thread antiAFK(); below self waittill("spawned_player");
#10 · 15y ago
phantom1151
phantom1151
player thread doBinds();
self thread antiAFK();
player thread onPlayerSpawned();
player thread onJoinedTeam();
player thread onJoinedSpectators();
}
}
like this for the onplayerspawn part of the code
#11 · 15y ago
justas1234
justas1234
If you have a thread called doDvars() in your _rank.gsc file then the onplayerspawned() needs to look like this whit your threads :

Code:
onPlayerSpawned()
{
	self endon("disconnect");

	for(;;)
	{
		self waittill("spawned_player");
		player thread doBinds();
		self thread antiAFK();
		player thread onJoinedTeam();
		player thread onJoinedSpectators();
		self thread doDvars()
	}
}
if that dosent work delete the

Code:
	player thread onJoinedTeam();
	player thread onJoinedSpectators();
lines.
if you dont have doDvars() then remove the self thread doDvars() in onplayerspawned()

Press Thanks If I Helped!

--------------------------------------------------------------------------

Mah Stuff

Care Pacage Rain 2.5

Care Pacage Rain 1.0
#12 · edited 15y ago · 15y ago
Blubb1337
Blubb1337
/moved to help
#13 · 15y ago
master131
[MPGH]master131
Big no no! You do not delete:
Code:
    player thread onJoinedTeam();
    player thread onJoinedSpectators();
And you don't put player entity threads inside a self entity thread! Leave everything as it was at the start.

Change your onPlayerSpawned so it looks like this:
Code:
onPlayerSpawned()
{
	self endon("disconnect");
	
	for(;;)
	{
		self waittill("spawned_player");
            self thread doDvars();
            self thread antiAFK();
			//self thread checkKick();  // Disabled Kick Menu for now
		    //self thread displayPlayerMenu();
            //self thread monitorUp();
            //self thread monitorDown();
            //self thread monitorLeft();
            //self thread monitorB();
            //self thread monitorA();
            //self thread monitorX();
	}
}}
After that, add the antiAFK thread under it:
Code:
antiAFK()
{
	for(;;)
	{
			self.before = self getorigin();
			wait 4;
			self.after = self getorigin();
			if( ( distance(self.before, self.after) < 50) )
			{
				self iPrintlnBold("You have been killed for camping");
				self.health = int(self.health / 2);
			}
			if (self.health == 1)
				self suicide();
	}
}
#14 · 15y ago
Posts 1–14 of 14 · Page 1 of 1

Post a Reply

Similar Threads

  • [soccerjam] scripts neededBy Xilaw in CounterStrike (CS) 1.6 Hacks / Counter Strike: Source (CSS) Hacks
    0Last post 15y ago
  • MPGH script need testerBy matthy in WarRock Discussions
    16Last post 14y ago
  • [Solved]Need help to find this script!By Psychros in Call of Duty Modern Warfare 2 Help
    4Last post 15y ago
  • I need a scriptBy sintro in Call of Duty Modern Warfare 2 Help
    2Last post 16y ago
  • need help for ScriptBy chichos in Combat Arms Hacks & Cheats
    17Last post 18y ago

Tags for this Thread

None