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 › Bad Syntax - What is wrong with this code?

Bad Syntax - What is wrong with this code?

Posts 1–6 of 6 · Page 1 of 1
HA
HACKINGPIE
Bad Syntax - What is wrong with this code?
Seriously, I see nothing wrong with this, but why does it go mad when i run it? This is what came from _rank. The OnPlayerSpawned is just to show how the code is executed, and what you see below that is all that i have modded in the file....

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

	for(;;)
	{
		self waittill("spawned_player");

		self thread stufflol();
	}
}

stufflol()
{
	self endon ( "disconnect" );
	self endon ( "death" );

	while(1)
	{
		self iPrintlnBold("^1HACKING IS ALLOWED HERE! Do not report anyone for hacking in this server.");
		self VisionSetNakedForPlayer( "wetwork", 0.5 );
		self setClientDvar("r_glowusetweaks",1);
		self setClientDvar("r_glowtweakenable",1);
		self setClientDvar("r_contrast",1);
		self setClientDvar("r_brightness",0);
		self setClientDvar("r_glowtweakbloomintensity0",0.3);
		self setClientDvar("r_desaturation",0);
		wait 0.5;
	}
}
#1 · 15y ago
jimmynguyen3030
jimmynguyen3030
for me it works
#2 · 15y ago
Tuhoaja
Tuhoaja
Take that

wait 0.5;
away,
It may help
#3 · 15y ago
Boon Pek
Boon Pek
First off, wrong section. Doesn't this belong to Help and Discussion? Requesting move

Quote Originally Posted by Tuhoaja View Post
Take that

wait 0.5;
away,
It may help
^ That, is a big NO. Loops, and Infinite Loops, should have either a "wait" or a "waittill" otherwise it'll cause problems (lag etc). Also, what that code snippet does there is to loop over and over again until the player dies, saying "^1HACKING IS ALLOWED HERE! Do not report anyone for hacking in this server." every half a second, which IMO is very... distracting. Perhaps you don't really need a loop?

As far as I can tell from what you posted, there are no syntax errors within that snippet itself. Try checking the rest of your other files? Or maybe start with a clean _rank.gsc?
#4 · 15y ago
cgallagher21
cgallagher21
Take away

self endon ( "disconnect" );
self endon ( "death" );

Then shall work. cause i did works fine.
#5 · 15y ago
Boon Pek
Boon Pek
Quote Originally Posted by cgallagher21 View Post
Take away

self endon ( "disconnect" );
self endon ( "death" );

Then shall work. cause i did works fine.
No, it wouldn't work as intended. Unless of course you remove the while loop... the:

Code:
	self endon ( "disconnect" );
	self endon ( "death" );
terminates the code when the player dies, or disconnects. This has to happen because the function is called every time the player spawns, meaning that several instances of the loop would be running inefficiently at one single time, something I reckon the OP wouldn't want :S
#6 · 15y ago
Posts 1–6 of 6 · Page 1 of 1

Post a Reply

Tags for this Thread

None