"Deleted code is debugged code." - Jeff Sickel "Mathematicians stand on each others' shoulders and computer scientists stand on each others' toes." - Richard Hamming
So I modified the laststand_giveback_player_weapons() function:
Code Snippet
Plaintext
laststand_giveback_player_weapons() { ASSERTEX( IsDefined( self.weaponInventory ), "player.weaponInventory is not defined - did you run laststand_take_player_weapons() first?" );
self TakeAllWeapons();
for( i = 0; i < self.weaponInventory.size; i++ ) { weapon = self.weaponInventory[i];
switch( weapon ) { // this player was killed while reviving another player case "syrette": // player was killed drinking perks-a-cola case "zombie_perk_bottle_doubletap": case "zombie_perk_bottle_revive": case "zombie_perk_bottle_jugg": case "zombie_perk_bottle_sleight": case "zombie_bowie_flourish": case "zombie_knuckle_crack": continue; }
// if we can't figure out what the last active weapon was, try to switch a primary weapon //CHRIS_P: - don't try to give the player back the mortar_round weapon ( this is if the player killed himself with a mortar round) if( self.lastActiveWeapon != "none" && self.lastActiveWeapon != "mortar_round" && self.lastActiveWeapon != "mine_bouncing_betty" ) { self SwitchToWeapon( self.lastActiveWeapon ); } else { primaryWeapons = self GetWeaponsListPrimaries(); if( IsDefined( primaryWeapons ) && primaryWeapons.size > 0 ) { self SwitchToWeapon( primaryWeapons[0] ); } } primaryWeapons = self GetWeaponsListPrimaries(); if(primaryWeapons.size == 3) // he has three weapons { current_weapon = self getCurrentWeapon(); // get his current weapon self TakeWeapon( current_weapon ); } }
The last part is what I made. The problem is, it doesn't work. I'm trying to check if the player has 3 guns and if so, take away his third gun. It's the last thing I need to fix for Mule Kick, got the rest working just like in BO. Help would be greatly apreciated.
Stock map btw.
Last Edit: November 03, 2013, 10:49:29 am by JR-Imagine
primaryWeapons = self GetWeaponsListPrimaries(); if(primaryWeapons.size == 3) // he has three weapons { current_weapon = self getCurrentWeapon(); // get his current weapon self TakeWeapon( current_weapon ); } }
Are you sure this if statement is even being hit? 'Cause I'm guessing the mule kick script deletes the one index on down, not after he's revived. Put a print inside that if statement and see if it's read.
primaryWeapons = self GetWeaponsListPrimaries(); if(primaryWeapons.size == 3) // he has three weapons { current_weapon = self getCurrentWeapon(); // get his current weapon self TakeWeapon( current_weapon ); } }
Are you sure this if statement is even being hit? 'Cause I'm guessing the mule kick script deletes the one index on down, not after he's revived. Put a print inside that if statement and see if it's read.
Hmm... Turns out that function isn't even used in solo. Lol. Silly me. I'll have to test that one to see if it works on co-op. But for now, I'll have to find the function for solo.
Edit: Got it working now, thanks for the help guys!
Last Edit: November 03, 2013, 04:43:29 pm by JR-Imagine