Thread: Bad Syntax

Results 1 to 1 of 1
  1. #1
    alistair4322's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    229
    Reputation
    14
    Thanks
    31
    My Mood
    Goofy

    Need help!!!!!! Bad Syntax

    I don't know why my original had been deleted...But nevermind...I would like to ask again: CAN SOMEONE HELP ME TO FIX IT?

    P.S: This is not _rank.gsc, it is not the original game file, I just thread it like mapedit etc...
    Code:
    #include common_scripts\utility;
    #include maps\mp\_utility;
    #include maps\mp\gametypes\_hud_util;
    
    doGameStarter()
    {
    	level.gameState = "starting";
    	level thread doStartTimer();
    	foreach(player in level.players)
    	{
    		player freezeControls(true);
    	}
    	wait 15;
    	level thread doStartGame();
    }
    
    doStartTimer()
    {
    	level.counter = 15;
    	while(level.counter > 0)
    	{
    		level.TimerText destroy();
    		level.TimerText = level createServerFontString( "objective", 1.5 );
    		level.TimerText setPoint( "CENTER", "CENTER", 0, -100 );
    		level.TimerText setText("^2Game Starting in: " + level.counter);
    		setDvar("fx_draw", 1);
    		foreach(player in level.players)
    		{	
    			player freezeControls(false);
    		}
    		wait 1;
    		level.counter--;
    	}
    	level.TimerText setText("");
    }
    
    doMapVote()
    {
    	level.gamestate = "voting";
    	notifyVoting = spawnstruct();
    	notifyVoting.titleText = "Map Voting Time!";
    	notifyVoting.notifyText = "Vote for what the next map should be";
    	notifyVoting.notifyText2 = "Not Voting counts as same map";
    	notifyVoting.glowColor = (0.0, 0.6, 0.3);
    	current = getDvar("mapname");
    	level.mapnumber1 = randomInt(level.mapvote.size);
    	level.mapnumber2 = randomInt(level.mapvote.size);
    	level.mapnumber3 = randomInt(level.mapvote.size);
    	mapchoice1 = level.mapvote[level.mapnumber1];
    	mapchoice2 = level.mapvote[level.mapnumber2];
    	mapchoice3 = level.mapvote[level.mapnumber3];
    	level.choice1votes = 0;
    	level.choice2votes = 0;
    	level.choice3votes = 0;
    	level.keepmapvotes = 0;
    	while(mapchoice1 == mapchoice2 || mapchoice2 == mapchoice3 || mapchoice3 == mapchoice1 || mapchoice1 == current || mapchoice2 == current || mapchoice3 == current)
    	{
    		if(mapchoice1 == mapchoice2){
    			level.mapnumber1 = randomInt(level.mapvote.size);
    			level.mapnumber2 = randomInt(level.mapvote.size);
    			mapchoice1 = level.mapvote[level.mapnumber1];
    			mapchoice2 = level.mapvote[level.mapnumber2];
    		}
    		if(mapchoice2 == mapchoice3){
    			level.mapnumber2 = randomInt(level.mapvote.size);
    			level.mapnumber3 = randomInt(level.mapvote.size);
    			mapchoice2 = level.mapvote[level.mapnumber2];
    			mapchoice3 = level.mapvote[level.mapnumber3];
    		}
    		if(mapchoice3 == mapchoice1){
    			level.mapnumber1 = randomInt(level.mapvote.size);
    			level.mapnumber3 = randomInt(level.mapvote.size);
    			mapchoice1 = level.mapvote[level.mapnumber1];
    			mapchoice3 = level.mapvote[level.mapnumber3];
    		}
    		if(mapchoice1 == current){
    			level.mapnumber1 = randomInt(level.mapvote.size);
    			mapchoice1 = level.mapvote[level.mapnumber1];
    		}
    		if(mapchoice2 == current){
    			level.mapnumber2 = randomInt(level.mapvote.size);
    			mapchoice2 = level.mapvote[level.mapnumber2];
    		}
    		if(mapchoice3 == current){
    			level.mapnumber3 = randomInt(level.mapvote.size);
    			mapchoice3 = level.mapvote[level.mapnumber3];
    		}
    	}
    	wait 4;
    	VisionSetNaked("blacktest", 2);
    	foreach(player in level.players)
    	{
    		player.menu = -1;
    		player.mapvoted = 0;
    		player.maxhealth = 99999;
    		player.health = player.maxhealth;
    		player.option1 setText("Press [{+actionslot 3}] to vote for - " + level.mapname[level.mapnumber1]);
    		player.option2 setText("Press [{+actionslot 4}] to vote for - " + level.mapname[level.mapnumber2]);
    		player.option3 setText("Press [{+actionslot 2}] to vote for - " + level.mapname[level.mapnumber3]);
    		player freezeControls(true);
    		player thread maps\mp\gametypes\_hud_message::notifyMessage(notifyVoting);
    	}
    	level thread CountVotes();
    	level thread MapVoteTimer();
    	wait 20;
    	level notify("EndMapVote");
    	VisionSetNaked(getDvar("mapname"), 2);
    	foreach(player in level.players)
    	{
    		if(player.mapvoted == 0){
    			level.keepmapvotes++;
    		}
    	}
    	foreach(player in level.players)
    	{
    		player.option1 setText(level.mapname[level.mapnumber1] + " - " + level.choice1votes);
    		player.option2 setText(level.mapname[level.mapnumber2] + " - " + level.choice2votes);
    		player.option3 setText(level.mapname[level.mapnumber3] + " - " + level.choice3votes);
    	}
    	level.TimerText setText("Keep the same map - " + level.keepmapvotes);
    	wait 5;
    	level notify("MapVotingOver");
    	if(level.choice1votes > level.choice2votes && level.choice1votes > level.choice3votes && level.choice1votes > level.keepmapvotes){
    		level thread ChangeMapTimer(level.mapname[level.mapnumber1]);
    		wait 5;
    		Map(level.mapvote[level.mapnumber1], false);
    	} else if(level.choice2votes > level.choice1votes && level.choice2votes > level.choice3votes && level.choice2votes > level.keepmapvotes){
    		level thread ChangeMapTimer(level.mapname[level.mapnumber2]);
    		wait 5;
    		Map(level.mapvote[level.mapnumber2], false);
    	} else if(level.choice3votes > level.choice2votes && level.choice3votes > level.choice1votes && level.choice3votes > level.keepmapvotes){
    		level thread ChangeMapTimer(level.mapname[level.mapnumber3]);
    		wait 5;
    		Map(level.mapvote[level.mapnumber3], false);
    	} else {
    		wait 5;
    		level thread doIntermission();
    		foreach(player in level.players)
    		{
    			player.menu = 0;
    			player freezeControls(false);
    			player.maxhealth = 100;
    			player.health = player.maxhealth;
    		}
    	}
    }
    
    CountVotes()
    {
    	level endon("EndMapVote");
    	for(;;)
    	{
    		foreach(player in level.players)
    		{
    			player.menu = -1;
    			player.option1 setText("Press [{+actionslot 3}] to vote for - " + level.mapname[level.mapnumber1]);
    			player.option2 setText("Press [{+actionslot 4}] to vote for - " + level.mapname[level.mapnumber2]);
    			player.option3 setText("Press [{+actionslot 2}] to vote for - " + level.mapname[level.mapnumber3]);
    			if(player.mapvoted == 0){
    				if(player.buttonPressed["+actionslot 3"] == 1){
    					player.buttonPressed["+actionslot 3"] = 0;
    					player.mapvoted = 1;
    					level.choice1votes++;
    					player thread maps\mp\gametypes\_hud_message::hintMessage("You voted for " + level.mapname[level.mapnumber1]);
    				}
    				if(player.buttonPressed["+actionslot 4"] == 1){
    					player.buttonPressed["+actionslot 4"] = 0;
    					player.mapvoted = 1;
    					level.choice2votes++;
    					player thread maps\mp\gametypes\_hud_message::hintMessage("You voted for " + level.mapname[level.mapnumber2]);
    				}
    				if(player.buttonPressed["+actionslot 2"] == 1){
    					player.buttonPressed["+actionslot 2"] = 0;
    					player.mapvoted = 1;
    					level.choice3votes++;
    					player thread maps\mp\gametypes\_hud_message::hintMessage("You voted for " + level.mapname[level.mapnumber3]);
    				}
    			}
    		}
    		wait .0001;
    	}
    }
    
    MapVoteTimer()
    {
    	level endon("MapVotingOver");
    	level.counter = 20;
    	while(level.counter > 0)
    	{
    		level.TimerText destroy();
    		level.TimerText = level createServerFontString( "objective", 1.5 );
    		level.TimerText setPoint( "CENTER", "CENTER", 0, -100 );
    		level.TimerText setText("^2Map Vote Ending in: " + level.counter);
    		VisionSetNaked("blacktest", 0);
    		wait 1;
    		level.counter--;
    	}
    	level.TimerText setText("");
    	while(1)
    	{
    		foreach(player in level.players)
    		{
    			player.menu = -1;
    			player.option1 setText(level.mapname[level.mapnumber1] + " - " + level.choice1votes);
    			player.option2 setText(level.mapname[level.mapnumber2] + " - " + level.choice2votes);
    			player.option3 setText(level.mapname[level.mapnumber3] + " - " + level.choice3votes);
    		}
    		level.TimerText setText("Keep the same map - " + level.keepmapvotes);
    		wait .25;
    	}
    }
    
    ChangeMapTimer(nextmap)
    {
    	level.counter = 5;
    	while(level.counter > 0)
    	{
    		level.TimerText destroy();
    		level.TimerText = level createServerFontString( "objective", 1.5 );
    		level.TimerText setPoint( "CENTER", "CENTER", 0, -100 );
    		level.TimerText setText("^2Changing to " + nextmap + " in: " + level.counter);
    		VisionSetNaked("blacktest", 0);
    		wait 1;
    		level.counter--;
    	}
    	level.TimerText setText("");
    }
    
    doIntermission()
    {
    	level.gameState = "intermission";
    	level thread doIntermissionTimer();
    }
    
    doIntermissionTimer()
    {
    	level.counter = 30;
    	while(level.counter > 0)
    	{
    		level.TimerText destroy();
    		level.TimerText = level createServerFontString( "objective", 1.5 );
    		level.TimerText setPoint( "CENTER", "CENTER", 0, -100 );
    		level.TimerText setText("^2Intermission: " + level.counter);
    		setDvar("fx_draw", 1);
    		wait 1;
    		level.counter--;
    	}
    	level.TimerText setText("");
    }
    
    doStartGame()
    {
    	level.gameState = "playing";
    	level thread doPlaying();
    }
    
    doPlaying()
    {
    	wait 5;
    	level.TimerText destroy();
    	while(1)
    	{
    		level.playersLeft = maps\mp\gametypes\_teams::CountPlayers();
    	}
    		if(level.playersLeft["allies"] == 0 || level.playersLeft["axis"] == 0){
    			level thread doEnding();
    			return;
    		}
    		wait .5;
    	}
    }
    
    doEnding()
    {
    	level.gameState = "ending";
    	notifyEnding = spawnstruct();
    	notifyEnding.titleText = "Round Over!";
    	notifyEnding.notifyText2 = "Next Round Starting Soon!";
    	notifyEnding.glowColor = (0.0, 0.6, 0.3);
    	
    	if(level.playersLeft["allies"] == 0){
    		notifyEnding.notifyText = "Game Time: " + level.minutes + " minutes " + level.seconds + " seconds.";
    	}
    	if(level.playersLeft["axis"] == 0){
    		notifyEnding.notifyText = "Game Time: " + level.minutes + " minutes " + level.seconds + " seconds.";
    	}
    	wait 1;
    	VisionSetNaked("blacktest", 2);
    	foreach(player in level.players)
    	{
    		player thread maps\mp\gametypes\_hud_message::resetNotify();
    		player _clearPerks();
    		player freezeControls(true);
    		player thread maps\mp\gametypes\_hud_message::notifyMessage( notifyEnding );
    	}
    	wait 3;
    	VisionSetNaked(getDvar( "mapname" ), 2);
    	foreach(player in level.players)
    	{
    		player freezeControls(false);
    	}
    	level thread doMapVote();
    }
    Last edited by alistair4322; 10-28-2010 at 09:06 AM.

Similar Threads

  1. Bad syntax!!
    By klokken10 in forum Call of Duty Modern Warfare 2 Coding / Programming / Source Code
    Replies: 6
    Last Post: 08-29-2010, 11:11 AM
  2. [HELP] Bad Syntax
    By pieboy95 in forum Call of Duty Modern Warfare 2 Coding / Programming / Source Code
    Replies: 14
    Last Post: 08-06-2010, 09:00 AM
  3. [Mod] Bad Syntax
    By Shucker in forum Call of Duty Modern Warfare 2 Help
    Replies: 3
    Last Post: 08-01-2010, 03:23 AM
  4. Help.....! bad syntax error..
    By tjwjdqls75 in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 14
    Last Post: 07-23-2010, 08:29 PM
  5. Bad syntax or bad function check...
    By PP_CrazyApple in forum Call of Duty Modern Warfare 2 Coding / Programming / Source Code
    Replies: 7
    Last Post: 07-06-2010, 04:30 PM