
07-29-2007, 04:10 AM
|
Billy Allan
|
 |
Join Date: Apr 2007
Posts: 804
|
|
Checking my script
i made a gun sciript, is it right?
---------------------------------------------------------------------
//#CLIENTSIDE
function onCreated() {
client.max_m16_ammo = 10;
client.m16_ammo=10;
this.m16_on = 0;
}
function onWeaponFired() {
if (this.m16_on = 0) {
this.m16m16_on == 1 && client.m16_ammo > 0) {
replaceani("walk", "nightmare_m16_walk");
replaceani("idle", "nightmare_m16_idle");
replaceani("sword", "nightmare_m16_shoot");
} else if (this.m16_on == 1 && client.m16_ammo == 0) {
replaceani("walk", "nightmare_m16_empty_walk");
replaceani("idle", "nightmare_m16_empty_idle");
replaceani("sword", "nightmare_m16_empty_shoot");
}
} else if (this.m16_on == 1) {
this.m16_on = 0;
replaceani("walk", "walk");
replaceani("idle", "idle");
replaceani("sword", "sword");
}
}
function onKeyPressed(keycode, keychar) {
if (this.m16_on == 1 && keychar == "r") {
if (client.m16_ammo == 0) {
setani("nightmare_m16_reload", " ");
client.m16_ammo = client.max_m16_ammo;
}
}
if (keychar == "s" && client.m16_ammo > 0) {
client.m16_ammo -= 1;
setshootparams("damage", 5);
temp.shootangle = getangle(vecx(player.dir), vecy(player.dir));
shoot(player.x+vecx(player.dir), player.y+vecy(player.dir), player.z, temp.shootangle, 0, 0, "nightmare_m16_fire", NULL);
}
} |
__________________
I am the devil, I am here to do to devils work.
|
|
|