Quote:
Originally Posted by Googi
Okay, first, don't post your script in attachments. Copy and paste it into your post enclosed in php tags.
Second, try and see if you can find which part of your script (if any) isn't executing when it's supposed to by having the different parts set player.chat to something or place a bomb somewhere or produce some other visible effect if they otherwise wouldn't.
|
its all working, and here:
PHP Code:
//Nightmare’s Faulty Gun
//#CLIENTSIDE
function onCreated() {
DeactivateGun();
this.ganilist = {
"idle",//nightmare_m16_idle
"sword",//nightmare_m16_fire
"walk"//nightmare_m16_walk
};
this.shootdelay = 0.1;
this.attackpower = 10;
client.strafe_direction = -1;
setTimer(0.05);
}
// Gun Code
function onTimeout() {
if(keydown2(160, true)) {
if(client.strafe_direction == -1) {
client.strafe_direction = player.dir;
}
player.dir = client.strafe_direction;
} else {
client.strafe_direction = -1;
}
setTimer(0.05);
}
function onKeyPressed() {
if(player.freezetime)
if(this.active) {
if(keydown(5)) {
freezeplayer(this.shootdelay);
setani(nightmare_m16_fire, NULL);
this.angle=getangle(vecx(playerdir),vecy(playerdir));
this.bulletangle = -.2;
setshootparams(player.account, this.attackpower = 3);
shoot(player.x+.3, player.y+.3, player.z, this.angle+random
(this.bulletangle, abs(this.bulletangle)), 0, 0, " bullet1",”” );
}
if(keydown(6)) {
DeactivateGun();
}
}
}
function onWeaponFired() {
if(!this.active) {
ActivateGun();
} else {
DeactivateGun();
}
}
function ActivateGun() {
setplayerprop ,nightmare_m16rifle.gif;
replaceani("idle", “nightmare_m16_idle”);
replaceani("sword", “nightmare_m16_attack”);
replaceani("walk",” nightmare_m16_walk”);
setani(“nightmare_m16_idle”);
this.active = true;
}
function DeactivateGun() {
replaceani("idle", "idle");
replaceani("sword", "sword");
replaceani("walk", "walk");
setani("idle", NULL);
this.active = false;
}
this one makes most sence (if any) and can exacute perfectly