Inside3D tutorials.
Created By: | The Devil |
eMail: | rjacob@utelco.tds.net |
Difficulty Scale: | Easy |
else if (self.weapon == IT_SHOTGUN) { player_shot1 (); W_FireShotgun (); self.attack_finished = time + 0.5; } Change it to this: else if (self.weapon == IT_SHOTGUN) { local float r; // Makes a new float r = random (); // sets r to a random number player_shot1 (); if (r < 0.03) //gives it a 1 in 50 chance of jamming { W_FireShotJam (); //make it jam self.attack_finished = time + 5; // make them wait 5 seconds } else { W_FireShotgun (); // Business as usual self.attack_finished = time + 0.5; } }
void() W_FireShotJam = { self.currentammo = self.ammo_shells = self.ammo_shells - 1; // Take Away a Shell centerprint (self, "Damn, It Jammed\n"); // Tell them it jammed };