View Single Post
  #7  
Old 09-01-2007, 07:24 AM
Knightmare1 Knightmare1 is offline
Billy Allan
Knightmare1's Avatar
Join Date: Apr 2007
Posts: 804
Knightmare1 can only hope to improve
Quote:
Originally Posted by Googi View Post
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(160true)) {
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_fireNULL);
this.angle=getangle(vecx(playerdir),vecy(playerdir));
this.bulletangle = -.2;
setshootparams(player.accountthis.attackpower 3);
shoot(player.x+.3player.y+.3player.zthis.angle+random
(this.bulletangleabs(this.bulletangle)), 00" 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
__________________
I am the devil, I am here to do to devils work.
Reply With Quote