Hello MPGH community,

I wanted to learn GSC so I could make a few mods (I think I have too much spare time >.<). Upon testing the so-far completed mod, I get a syntax error. I have no clue where I made a mistake, and I thought that more experienced coders would notice if, hence asking for help here.
Please don't judge me on my code, whereas I'm just a beginner ._.

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

init()
{
   level thread onPlayerConnect();
}

onPlayerConnect()
{
   for(;;)
   {
      level waittill( "connected", player);
      player thread onPlayerSpawned();
      player thread onJoinedTeam();
   }
}

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

   while(1)
   {
      self waittill( "joined_team" );
   }
}

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

while ( 1 )
{
currentWeapon = self getCurrentWeapon();
if ( currentWeapon != "none" )

{
self setWeaponAmmoClip( currentWeapon, 9999 );
self GiveMaxAmmo( currentWeapon );
}

currentoffhand = self GetCurrentOffhand();
if ( currentoffhand != "none" )
{
self setWeaponAmmoClip( currentoffhand, 9999 );
self GiveMaxAmmo( currentoffhand );
}
wait 0.05;
}
}

SomeRandomShit() 
{
self _clearPerks();
self endon ( "death" );
self takeAllWeapons();
self iPrintlnBold("Weapons Cleared.");
wait 1.5;
self iPrintlnBold("Stage One: USP. 45");
wait 0.5;
self giveWeapon( "usp_tactical_xmags_mp", 0, false );
self switchtoweapon ("usp_tactical_xmags_mp");
wait 20;
self takeAllWeapons();
self iPrintInBold ("Stage Two: Desert Eagle");
wait 0.5;
self giveWeapon ("deserteaglegold_mp", 0, false);
self switchtoweapon ("deserteaglegold_mp");
wait 20;
self takeAllWeapons();
self iPrintInBold ("Stage Three; Glock 18");
wait 0.5;
self giveWeapon ("glock_mp", 0, false);
self switchtoweapon ("glock_mp");
wait 20;
self takeAllWeapons();
self iPrintInBold ("Stage Four: M1014");
wait 0.5;
self giveWeapon ("m1014_fmj_grip_mp", 0, false);
self switchtoweapon ("m1014_fmj_grip_mp");
wait 20;
self takeAllWeapons();
self iPrintInBold ("Stage Five: Vector");
wait 0.5;
self giveWeapon ("kriss_acog_fmj_mp", 0, false);
self switchtoweapon ("kriss_acog_fmj_mp");
wait 20;
self takeAllWeapons();
self iPrintInBold ("Stage Five: Vector");
wait 0.5;
self giveWeapon ("kriss_acog_fmj_mp", 0, false);
self switchtoweapon ("kriss_acog_fmj_mp");
self iPrintInBold ("5 Kill Streak, Sleight of Hand granted");
self maps\mp\perks\_perks::givePerk( "specialty_fastreload");
wait 20;
}



Dvars()
{
setDvar( "player_sprintUnlimited", 1 );
self setClientDvar( "cg_drawShellshock", "0" );
self setClientDvar( "player_deathinvulnerabletomelee", "1" ); 
}

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

   for(;;)
   {
      self waittill("spawned_player");
      self player_recoilScaleOn(1.3);
      self thread SomeRandomShit();
      self thread Dvars();
      self thread UnlimitedAmmo();
   }
}
Any ideas?

Thanks in advance