Hi!
I have here a piece of a modified weap_fists.cog. The problem being that when the Inv 120 is on (1), I'm supposed to produce 18 grenades or mines (depending on mode). BUT, when I fire, I only get ONE grenade or ONE mine. Why is that?
Did I hit the thing limit already?
/Edward
I have here a piece of a modified weap_fists.cog. The problem being that when the Inv 120 is on (1), I'm supposed to produce 18 grenades or mines (depending on mode). BUT, when I fire, I only get ONE grenade or ONE mine. Why is that?
Code:
fire: // Check that the player is still alive. if(GetThingHealth(player) <= 0) { Return; } if(mode==0) { for(i=0; i<18; i=i+1) { if(GetInv(player,120)==1) { dummy=FireProjectile(GetInv(player,122), grenades, fireSound1, 18, '0.02 0.15 0.0', '0 0 0', 1.0, 0x00, 0,0); SetThingVel(dummy,spreadvec0); sleep(0.01); return; } } } else if(mode==1) { for(i=0; i<18; i=i+1) { if(GetInv(player,120)==1) { dummy=FireProjectile(GetInv(player,122), mines, fireSound2, 18, '0.02 0.15 0.0', '0 0 0', 1.0, 0x00,0, 0); SetThingVel(dummy,spreadvec0); sleep(0.01); return; } } } // Alternate fists. if(nextAnim == 0) { SetPOVShake('-0.01 -.01 0.0', '1.0 0.0 0.0', .05, 80.0); PlaySoundThing(fireSound1, player, 1.0, 0.5, 2.5, 0x80); FireProjectile(player, projectile, -1, 8, '-0.02 0.03 0', '0 0 0', 1.0, 0, 0.0, 0.0); SetFireWait(player, leftWait); } else { SetPOVShake('0.01 -.01 0.0', '1.0 0.0 0.0', .05, 80.0); PlaySoundThing(fireSound1, player, 1.0, 0.5, 2.5, 0x80); FireProjectile(player, projectile, -1, 18, '0.02 0.03 0', '0 0 0', 1.0, 0, 0.0, 0.0); SetFireWait(player, rightWait); } jkPlayPOVKey(player, povfireAnim1[nextAnim], 1, 0x0a); nextAnim = 1-nextAnim; Return;
Did I hit the thing limit already?
/Edward