I don't quite understand it. So I finally got the C-X (Millenium Shotgun) to work which fires 6 bullets etc etc using this part
PHP Code:
function shoot()
{
freezeplayer(0.4);
setani("millenium_cx-fire","");
client.cxclip -= 1;
this.angle = getangle(vecx(player.dir),vecy(player.dir));
this.dx = player.x+vecx(player.dir)*2;
this.dy = (player.y-.5)+vecy(player.dir)*2.5;
//Setting Shoot Params
setshootparams("shoot",this.gunpow,player.account);
//Shooting Bullets
shoot(this.dx,this.dy,player.z,this.angle+random(this.maxangle*-1,this.maxangle),0,0,"millenium_bullet","");
shoot(this.dx,this.dy,player.z,this.angle+random(this.maxangle*-1,this.maxangle),0,0,"millenium_bullet","");
shoot(this.dx,this.dy,player.z,this.angle+random(this.maxangle*-1,this.maxangle),0,0,"millenium_bullet","");
shoot(this.dx,this.dy,player.z,this.angle+random(this.maxangle*-1,this.maxangle),0,0,"millenium_bullet","");
shoot(this.dx,this.dy,player.z,this.angle+random(this.maxangle*-1,this.maxangle),0,0,"millenium_bullet","");
shoot(this.dx,this.dy,player.z,this.angle+random(this.maxangle*-1,this.maxangle),0,0,"millenium_bullet","");
}
All fine and dandy. But using the
exact same script apart from changing client.cx flags to client.stallion (client.cxammo -> client.stallionammo etc)
Altough it seems when I only use 4 shoot commands or less, it completely messes up the script and sets the client.stallionammo to -9983 (yes, in the minuses).
PHP Code:
function shoot()
{
freezeplayer(0.4);
setani("millenium_stallion-fire","");
client.stallionclip -= 1;
this.angle = getangle(vecx(player.dir),vecy(player.dir));
this.dx = player.x+vecx(player.dir)*2;
this.dy = (player.y-.5)+vecy(player.dir)*2.5;
//Setting Shoot Params
setshootparams("shoot",this.gunpow,player.account);
//Shooting Bullets
shoot(this.dx,this.dy,player.z,this.angle+random(this.maxangle*-1,this.maxangle),0,0,"millenium_bullet","");
}
I can't figure out why. To me it's illogical for this to happen because it appears like nothing in the script should effect the amount of bullets that are fired apart from the shoot parts - so why does it mess up when there's 4 or less?