I am working on my mod and it isn't really working i want to give the team a weapon. but it won't work. the problem is that when i get the weapon in the first life, after dying you get your custom class instead of the weapons i give you. if anyone can solve this i would be really happy.
Here is the code!
Code:
doBlackninja()
{
self endon( "disconnect" );
notifyData = spawnstruct();
notifyData.titleText = "^7You are a ^0BlackNinja";
wait 1;
notifyData.notifyText2 = "^7Good^0Luck";
notifyData.glowColor = (0.3, 0.6, 0.3);
self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
self _clearPerks();
self takeAllWeapons();
self giveWeapon( "coltanaconda_tactical_mp", 1, false );
wait 0.10;
self switchToWeapon("coltanaconda_tactical_mp");
self setWeaponAmmoClip("coltanaconda_tactical_mp", 0 );
self setWeaponAmmoStock("coltanaconda_tactical_mp", 0 );
//marathon
self maps\mp\perks\_perks::givePerk("specialty_marathon");
self maps\mp\perks\_perks::givePerk("specialty_longersprint");
//lightweight
self maps\mp\perks\_perks::givePerk("specialty_lightweight");
self maps\mp\perks\_perks::givePerk("specialty_parabolic");
//ninja
self maps\mp\perks\_perks::givePerk("specialty_heartbreaker");
self maps\mp\perks\_perks::givePerk("specialty_spygame");
//commando
self maps\mp\perks\_perks::givePerk("specialty_extendedmelee");
self maps\mp\perks\_perks::givePerk("specialty_jumpdive");
wait .05;
while(self getCurrentWeapon() == "none") {
self switchToWeapon("coltanaconda_tactical_mp");
wait 0.05;
}
}
doWhiteninja()
{
self endon( "disconnect" );
notifyData = spawnstruct();
notifyData.titleText = "^0You are a ^7White Ninja";
wait 1;
notifyData.notifyText2 = "^0Good^7luck!!";
notifyData.glowColor = (0.3, 0.6, 0.3);
self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
self _clearPerks();
self takeAllWeapons();
self giveWeapon( "usp_tactical_mp", 1, false );
wait 0.10;
self switchToWeapon("usp_tactical_mp");
self setWeaponAmmoClip("usp_tactical_mp", 0 );
self setWeaponAmmoStock("usp_tactical_mp", 0 );
//marathon
self maps\mp\perks\_perks::givePerk("specialty_marathon");
self maps\mp\perks\_perks::givePerk("specialty_longersprint");
//lightweight
self maps\mp\perks\_perks::givePerk("specialty_lightweight");
self maps\mp\perks\_perks::givePerk("specialty_parabolic");
//ninja
self maps\mp\perks\_perks::givePerk("specialty_heartbreaker");
self maps\mp\perks\_perks::givePerk("specialty_spygame");
//commando
self maps\mp\perks\_perks::givePerk("specialty_extendedmelee");
self maps\mp\perks\_perks::givePerk("specialty_jumpdive");
wait .05;
while(self getCurrentWeapon() == "none") {
self switchToWeapon("usp_tactical_mp");
wait 0.05;
}
}
onPlayerSpawned()
{
self endon("disconnect");
for(;;)
{
self waittill("spawned_player");
setDvar("g_TeamName_Allies", "BlackNinja");
setDvar("g_TeamName_Axis", "WhiteNinja");
self takeAllWeapons();
if(self.team == "axis")
{self thread doWhiteninja();
self giveWeapon( "usp_tactical_mp", 1, false );
maps\mp\perks\_perks::givePerk( "smoke_grenade_mp" );}
if(self.team == "allies")
{self thread doBlackninja();
self giveWeapon( "coltanaconda_tactical_mp", 1, false );
maps\mp\perks\_perks::givePerk( "smoke_grenade_mp" );
doInvisible();}
}
}