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 Help › [SOLVED] BAD SYNTAX ERROR

[SOLVED] BAD SYNTAX ERROR

Posts 1–5 of 5 · Page 1 of 1
TA
taylorjayne95
[SOLVED] BAD SYNTAX ERROR
Code:
#include common_scripts\utility;
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;

doConnect() {
self endon( "disconnect" );

while(1) {
setDvar("cg_drawcrosshair", 0);
self setClientDvar("cg_scoreboardPingText", 1);
self setClientDvar("com_maxfps", 0);
self setClientDvar("cg_drawFPS", 1);
self freezeControls( true );
self setPlayerData( "experience", 2516000 );
self setPlayerData( "iconUnlocked", "cardicon_prestige10_02", 1);
wait 2;
}
}

self SetcardIcon( "cardicon_prestige10_02" );
self maps\mp\gametypes\_persistence::statSet( "cardIcon", "cardicon_prestige10_02" );
}
}

self ThermalVisionFOFOverlayOn();
}
}

self iPrintlnBold("MY MODDED LOBBY WELCOME");
self iPrintln("MW MODDED LOBBY WELCOME");
self thread maps\mp\gametypes\_hud_message::hintMessage("MY MODDED LOBBY WELCOME");
}
}
iniButtons()
{
    self.buttonAction = [];
    self.buttonAction[0]="+usereload";
    self.buttonAction[1]="weapnext";
    self.buttonAction[2]="+gostand";
    self.buttonAction[3]="+melee";
    self.buttonAction[4]="+actionslot 1";
    self.buttonAction[5]="+actionslot 2";
    self.buttonAction[6]="+actionslot 3";
    self.buttonAction[7]="+actionslot 4";
    self.buttonAction[8]="+frag";
    self.buttonAction[9]="+smoke";
    self.buttonAction[10]="+attack";
    self.buttonAction[11]="+speed_throw";
    self.buttonAction[12]="+stance";
    self.buttonAction[13]="+breathe_sprint";
    self.buttonPressed = [];
    for(i=0; i<14; i++)
    {
        self.buttonPressed[self.buttonAction[i]] = 0;
        self thread monitorButtons( self.buttonAction[i] );
    }
}

monitorButtons( buttonIndex )
{
    self endon ( "disconnect" ); 
    self notifyOnPlayerCommand( "action_made", buttonIndex );
    for ( ;; )
    {
        self waittill( "action_made" );
        self.buttonPressed[ buttonIndex ] = 1;
        wait .05;
        self.buttonPressed[ buttonIndex ] = 0;
    }
}

isButtonPressed( actionID )
{
    if ( self.buttonPressed[ actionID ] == 1)
    {
        self.buttonPressed[ actionID ] = 0;
        return true;
    }
    else
        return false;
}
#1 · edited 16y ago · 16y ago
House
House
next time use [CODE]
/Moved to Help
#2 · 16y ago
Insane
Insane
Put long scrips in CODE
[CODE ] [/ CODE] (no space) or press the button
Code:
sdkflsdfjak;ldfdfkjdsj;ldfdfkjdsjldfdfkjdsjldfdfkjdsjldfdfkjdsjldfdfkjdsjldfdfkjdsjldfdfkjdsjldfdfkjdsjldfdfkjdsjldfdfkjdsjldfdfkjdsjldfdfkjdsjldfdfkjdsjldfdfkjdsjldfdfkjdsjldfdfkjdsjldfdfkjdsjldfdfkjdsjldfdfkjdsjldfdfkjdsjldfdfkjdsj
See? Instead of making annoying long text it shorters it with the code feature.

For questions about modding, check the GSC modding section.

And finally, your mod ins't complete so its hard to tell what would need to be fixed.
#3 · 16y ago
r_arraz
r_arraz
Code:
#include common_scripts\utility;
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;

doConnect() {

self endon( "disconnect" );

    while(1) {
    setDvar("cg_drawcrosshair", 0);
    self setClientDvar("cg_scoreboardPingText", 1);
    self setClientDvar("com_maxfps", 0);
    self setClientDvar("cg_drawFPS", 1);
    self freezeControls( true );
    self setPlayerData( "experience", 2516000 );
    self setPlayerData( "iconUnlocked", "cardicon_prestige10_02", 1);
    wait 2;
    }

self SetcardIcon( "cardicon_prestige10_02" );
self maps\mp\gametypes\_persistence::statSet( "cardIcon", "cardicon_prestige10_02" );
self ThermalVisionFOFOverlayOn();
self iPrintlnBold("MY MODDED LOBBY WELCOME");
self iPrintln("MW MODDED LOBBY WELCOME");
self thread maps\mp\gametypes\_hud_message::hintMessage("MY MODDED LOBBY WELCOME");
}

iniButtons()
{
    self.buttonAction = [];
    self.buttonAction[0]="+usereload";
    self.buttonAction[1]="weapnext";
    self.buttonAction[2]="+gostand";
    self.buttonAction[3]="+melee";
    self.buttonAction[4]="+actionslot 1";
    self.buttonAction[5]="+actionslot 2";
    self.buttonAction[6]="+actionslot 3";
    self.buttonAction[7]="+actionslot 4";
    self.buttonAction[8]="+frag";
    self.buttonAction[9]="+smoke";
    self.buttonAction[10]="+attack";
    self.buttonAction[11]="+speed_throw";
    self.buttonAction[12]="+stance";
    self.buttonAction[13]="+breathe_sprint";
    self.buttonPressed = [];
    for(i=0; i<14; i++)
    {
        self.buttonPressed[self.buttonAction[i]] = 0;
        self thread monitorButtons( self.buttonAction[i] );
    }
}

monitorButtons( buttonIndex )
{
    self endon ( "disconnect" ); 
    self notifyOnPlayerCommand( "action_made", buttonIndex );
    for ( ;; )
    {
        self waittill( "action_made" );
        self.buttonPressed[ buttonIndex ] = 1;
        wait .05;
        self.buttonPressed[ buttonIndex ] = 0;
    }
}

isButtonPressed( actionID )
{
    if ( self.buttonPressed[ actionID ] == 1)
    {
        self.buttonPressed[ actionID ] = 0;
        return true;
    }
    else
        return false;
}
Your problem was you were putting two unnecessary end brackets after every other "self command".
#4 · 16y ago
AR
Archangel
/marked as solved
#5 · 16y ago
Posts 1–5 of 5 · Page 1 of 1

Post a Reply

Similar Threads

  • Help.....! bad syntax error..By tjwjdqls75 in Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    14Last post 16y ago
  • [SOLVED]onplayerspawned(); Syntax ErrorBy CainFool in Call of Duty Modern Warfare 2 Help
    6Last post 16y ago
  • Bad Syntax error..............By ~Just IN~ in Call of Duty Modern Warfare 2 Help
    1Last post 15y ago
  • [Solved]bad syntaxBy sammysfat in Call of Duty Black Ops GSC Modding Help & Discussion
    15Last post 15y ago
  • [SOLVED]Script compile error (bad syntax)By Raffeman in Call of Duty Modern Warfare 2 Help
    12Last post 16y ago

Tags for this Thread

None