View Single Post
  #1  
Old 01-25-2012, 04:05 AM
khortez khortez is offline
PrototypeX
khortez's Avatar
Join Date: Dec 2008
Posts: 91
khortez will become famous soon enough
Need help with shoot()

I have tried testing it to see if it would shoot a arrow or anything, but it was a no go, I don't even see a shadow being shot. so if anyone could point out what i need to do to get this working, it would be nice, thanks in advance.

Also, additional constructive criticism about the script i have would be nice too. like what i should do instead, or something i should not have done on it would be helpful.


PHP Code:
//#CLIENTSIDE
function onCreated() {
  
this.equip false;
  
this.gunout false;
}

function 
onKeyPressed(codekey) {
  if (
key == "d") {
    if (
this.gunout == true) {
      
onFire();
    } else {
      
onGani();
    }
  }
  if (
key == "a") {
    
this.equip this.gunout false;
    
setani("idle"null);
    
replaceani("idle""idle");
    
replaceani("walk""walk");
    
player.chat "Gun off!";
  }
}

function 
onGani() {
  
this.equip true;
  
setani(this.gani_idlenull);
  
replaceani("idle"this.gani_idle);
  
replaceani("walk"this.gani_walk);
  
player.chat "Gun on!";
  
this.gunout true;
}

//problems below

function onFire() {
  
player.chat "Firing!";
  
setani(this.gani_firenull);
  
setshootparams("arrow"player.account);
  
temp.angle getangle(vecx(player.dir), vecy(player.dir));
  
temp.zangle pi 4;
  
temp.power 1.5;
  
shoot(player.xplayer.yplayer.ztemp.angletemp.zangletemp.power"arrow""barrow0.png");

also, whats that second parameter in setani()?
Reply With Quote