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(code, key) {
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_idle, null);
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_fire, null);
setshootparams("arrow", player.account);
temp.angle = getangle(vecx(player.dir), vecy(player.dir));
temp.zangle = pi / 4;
temp.power = 1.5;
shoot(player.x, player.y, player.z, temp.angle, temp.zangle, temp.power, "arrow", "barrow0.png");
}
also, whats that second parameter in setani()?