Hey guys! I was editing the zombie mod to make it cooler... basically, what im trying to do is make it so that the zombies have a throwing knife, but once they throw it, they cant pick it up, but it regenerates in 5 seconds.... So Basically, this is what i got, but its not working. Im getting bad syntax error...

Im new to C++ and started yesterday with this modding, so please, give me a break.

Read the \\'s that i put in there. they explain what im trying to do.. and you will prob be able to see what im doing wrong them!


Code:
FixWeaponGlitch() \\this part of the code is not modded... just put it in here for you to see becasue it connects to the tkmod thread
{
	self endon("disconnect");
	self endon("death");

	while( 1 ){
	if(self getCurrentWeapon() != level.ZombieWeapon)
	{
		self TakeAllWeapons();
		self giveWeapon( level.ZombieWeapon, 0, false );
		self switchToWeapon( level.ZombieWeapon );

	}
		self SetWeaponAmmoStock( level.ZombieWeapon, 0 );
		self SetWeaponAmmoClip( level.ZombieWeapon, 0 );
                thread tkmod(); \\i think i did this right? right....? very it for me please
	wait 0.05;
	
	}
}

tkmod(); \\When i say tk, i mean throwing knife...
{
self maps\mp\perks\_perks::givePerk("throwingknife_mp"); \\gives the zombie a throwing knife
self endon("death"); \\takes away the knife on death.. correct?
for(;;)
{
self waittill("weapon_fired"); \\this should mean that when the weapons fired, it moves to the next line... if im right?
self _disableOffhandWeapons(); \\since the weapons is fired, it blocks firing again until 5 seconds.
self _disableWeapon();
wait 5
              thread tkmod2();
}
}

tkmod2();
{
self _enalbeOffhandWeapons();
self _enableWeapon();
{
self maps\mp\perks\_perks::givePerk("throwingknife_mp");
self endon("death");
for(;;)
{
self waittill("weapon_fired");
self _disableOffhandWeapons();
self _disableWeapon();
wait 5
thread tkmod2();
}
}
What am i doing wrong? THANKS! And if you can even edit it for me so it would work, it would be greatly appreciated!


---------------------------------------


Ok. I made it simpler, i think.. but its still not working. Im getting bad syntax still... This is what i have:
Code:
{
		self maps\mp\perks\_perks::givePerk("throwingknife_mp");
		self waittill ( "weapon_fired" );
		wait 5
}
{
		self maps\mp\perks\_perks::givePerk("throwingknife_mp");
}
But thats not made so that you cant pick it up again. Any ideas? PLEASE!!!