Post: Syntax error in Zombieland
10-25-2017, 10:20 PM #1
lloosemore1
Save Point
(adsbygoogle = window.adsbygoogle || []).push({}); Could someone help me with this error, i tried deleting the "wait" part but it keeps saying bad syntax in the line above.*You must login or register to view this content.
10-25-2017, 10:51 PM #2
neb
Save Point
try adding another } at the end
Last edited by neb ; 10-25-2017 at 10:55 PM.
10-26-2017, 01:07 PM #3
lloosemore1
Save Point
Where about should the } be, i put it next to the other one and on the line below and it still says error
10-26-2017, 02:24 PM #4
1UP
Banned
Originally posted by lloosemore1 View Post
Where about should the } be, i put it next to the other one and on the line below and it still says error


Try posting your actual code because not only can we not see the end of the first if statement, we don't see the end of the loop either.
10-26-2017, 04:08 PM #5
lloosemore1
Save Point
Originally posted by Oneup View Post
Try posting your actual code because not only can we not see the end of the first if statement, we don't see the end of the loop either.


This is the code from line 333 to 470:

    teammonitor()
{
self endon( "disconnect" );
for(;Winky Winky
{
if( self issplitscreen() )
{
}
if( isalive( self ) && self.pers[ "team"] != "axis" && self.startingzombie )
{
self changeteam( "axis" );
self.status = "zombie";
wait 0.1;
self notify( "menuresponse", "changeclass", "class_smg" );
self.startingzombie = 0;
}
if( self.status == "human" && self.pers[ "team"] == "axis" )
{
self changeteam( "allies" );
self.status = "human";
wait 0.1;
self notify( "menuresponse", "changeclass", "class_smg" );
}
if( self.status == "zombie" && self.pers[ "team"] == "allies" )
{
self changeteam( "axis" );
self.status = "zombie";
wait 0.1;
self notify( "menuresponse", "changeclass", "class_smg" );
}
if( self.status == "human" && self.pers[ "team"] == "axis" )
{
if( level.zombieficationtime > 0 && !(level.inprematchperiod) )
{
self changeteam( "allies" );
self.status = "human";
wait 1;
if( self.status != "zombie" && level.zombieficationtime > 0 && self.pers[ "team"] == "axis" )
{
self changeteam( "allies" );
self.status = "human";
wait 0.5;
self notify( "menuresponse", "changeclass", "class_smg" );
if( self.pers[ "team"] == "axis" )
{
self changeteam( "axis" );
self.status = "zombie";
wait 0.1;
self notify( "menuresponse", "changeclass", "class_smg" );
}
}
}
}
wait 0.01;
}

}

teammonitorcustom()
{
self endon( "disconnect" );
for(;Winky Winky
{
self waittill( "joined_team" );
wait 0.1;
if( self.pers[ "team"] == "axis" && self.status == "human" )
{
self changeteam( "allies" );
self.status = "human";
wait 0.1;
self notify( "menuresponse", "changeclass", "class_smg" );
}
if( self.pers[ "team"] == "allies" && self.status == "zombie" )
{
self changeteam( "axis" );
self.status = "zombie";
wait 0.1;
self notify( "menuresponse", "changeclass", "class_smg" );
self thread closemenus();
}
wait 0.05;
}

}

damagemonitor()
{
self endon( "disconnect" );
for(;Winky Winky
{
if( self.status == "zombie" )
{
self waittill( "damage", damage, attacker, direction, point, type, tagname, modelname, partname, weaponname );
if( type == "MOD_FALLING" )
{
self.givecash = 0;
self waittill( "spawned_player" );
self.givecash = 1;
}
}
wait 0.01;
}

}

monitorgame()
{
level endon( "game_ended" );
level endon( "winnerDeclared" );
level.timetopausegame = 10;
wait 1;
for(;Winky Winky
{
if( !(level.inprematchperiod) )
{
if( level.currentgametime == level.timetopausegame )
{
pausetimer();
}
level.zombiecount = 0;
level.humancount = 0;
wait 0.05;
foreach( player in level.players )
{
if( player.status == "zombie" )
{
level.zombiecount = level.zombiecount + 1;
}
if( player.status == "human" )
{
level.humancount = level.humancount + 1;
}
if( level.zombieselectioninprogress )
{
level.zombiecount = 1337;
}
wait 0.05;
}
10-26-2017, 06:41 PM #6
1UP
Banned
Originally posted by lloosemore1 View Post
the wink faces is just ; )


Use the code tags
10-26-2017, 07:38 PM #7
lloosemore1
Save Point
Originally posted by Oneup View Post
Use the code tags


i don't really know what u mean by "code tags"
10-26-2017, 09:20 PM #8
1UP
Banned
Originally posted by lloosemore1 View Post
This is the code from line 333 to 470:

    teammonitor()
{
self endon( "disconnect" );
for(;Winky Winky
{
if( self issplitscreen() )
{
}
if( isalive( self ) && self.pers[ "team"] != "axis" && self.startingzombie )
{
self changeteam( "axis" );
self.status = "zombie";
wait 0.1;
self notify( "menuresponse", "changeclass", "class_smg" );
self.startingzombie = 0;
}
if( self.status == "human" && self.pers[ "team"] == "axis" )
{
self changeteam( "allies" );
self.status = "human";
wait 0.1;
self notify( "menuresponse", "changeclass", "class_smg" );
}
if( self.status == "zombie" && self.pers[ "team"] == "allies" )
{
self changeteam( "axis" );
self.status = "zombie";
wait 0.1;
self notify( "menuresponse", "changeclass", "class_smg" );
}
if( self.status == "human" && self.pers[ "team"] == "axis" )
{
if( level.zombieficationtime > 0 && !(level.inprematchperiod) )
{
self changeteam( "allies" );
self.status = "human";
wait 1;
if( self.status != "zombie" && level.zombieficationtime > 0 && self.pers[ "team"] == "axis" )
{
self changeteam( "allies" );
self.status = "human";
wait 0.5;
self notify( "menuresponse", "changeclass", "class_smg" );
if( self.pers[ "team"] == "axis" )
{
self changeteam( "axis" );
self.status = "zombie";
wait 0.1;
self notify( "menuresponse", "changeclass", "class_smg" );
}
}
}
}
wait 0.01;
}

}

teammonitorcustom()
{
self endon( "disconnect" );
for(;Winky Winky
{
self waittill( "joined_team" );
wait 0.1;
if( self.pers[ "team"] == "axis" && self.status == "human" )
{
self changeteam( "allies" );
self.status = "human";
wait 0.1;
self notify( "menuresponse", "changeclass", "class_smg" );
}
if( self.pers[ "team"] == "allies" && self.status == "zombie" )
{
self changeteam( "axis" );
self.status = "zombie";
wait 0.1;
self notify( "menuresponse", "changeclass", "class_smg" );
self thread closemenus();
}
wait 0.05;
}

}

damagemonitor()
{
self endon( "disconnect" );
for(;Winky Winky
{
if( self.status == "zombie" )
{
self waittill( "damage", damage, attacker, direction, point, type, tagname, modelname, partname, weaponname );
if( type == "MOD_FALLING" )
{
self.givecash = 0;
self waittill( "spawned_player" );
self.givecash = 1;
}
}
wait 0.01;
}

}

monitorgame()
{
level endon( "game_ended" );
level endon( "winnerDeclared" );
level.timetopausegame = 10;
wait 1;
for(;Winky Winky
{
if( !(level.inprematchperiod) )
{
if( level.currentgametime == level.timetopausegame )
{
pausetimer();
}
level.zombiecount = 0;
level.humancount = 0;
wait 0.05;
foreach( player in level.players )
{
if( player.status == "zombie" )
{
level.zombiecount = level.zombiecount + 1;
}
if( player.status == "human" )
{
level.humancount = level.humancount + 1;
}
if( level.zombieselectioninprogress )
{
level.zombiecount = 1337;
}
wait 0.05;
}


Well you have a few things wrong here. I am assuming this is your first time?
You are missing some closing braces
1. for your if statement, 1 for your for and another for the method

    

monitorgame()
{
level endon( "game_ended" );
level endon( "winnerDeclared" );
level.timetopausegame = 10;
wait 1;
for(;Winky Winky
{
if( !(level.inprematchperiod) )
{
if( level.currentgametime == level.timetopausegame )
{
pausetimer();
}
level.zombiecount = 0;
level.humancount = 0;
wait 0.05;

foreach( player in level.players )
{
if( player.status == "zombie" )
{
level.zombiecount = level.zombiecount + 1;
}
if( player.status == "human" )
{
level.humancount = level.humancount + 1;
}
if( level.zombieselectioninprogress )
{
level.zombiecount = 1337;
}
wait 0.05;
}
}
}
}



Properly indenting your code makes it easier to catch things like this.
10-26-2017, 10:45 PM #9
lloosemore1
Save Point
Originally posted by Oneup View Post
Well you have a few things wrong here. I am assuming this is your first time?
You are missing some closing braces
1. for your if statement, 1 for your for and another for the method

    

monitorgame()
{
level endon( "game_ended" );
level endon( "winnerDeclared" );
level.timetopausegame = 10;
wait 1;
for(;Winky Winky
{
if( !(level.inprematchperiod) )
{
if( level.currentgametime == level.timetopausegame )
{
pausetimer();
}
level.zombiecount = 0;
level.humancount = 0;
wait 0.05;

foreach( player in level.players )
{
if( player.status == "zombie" )
{
level.zombiecount = level.zombiecount + 1;
}
if( player.status == "human" )
{
level.humancount = level.humancount + 1;
}
if( level.zombieselectioninprogress )
{
level.zombiecount = 1337;
}
wait 0.05;
}
}
}
}



Properly indenting your code makes it easier to catch things like this.


so if i were to copy this into GSC would this work? and yes it is my 1st time, i tried to do this as best i could, if you could send me a good tutorial on how to code stuff like this it would be great!
10-26-2017, 10:52 PM #10
lloosemore1
Save Point
I copyed it into GSC and it worked but now a freeze when i load into the game. Anyway around that?

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo