Thread: setani problems
View Single Post
  #10  
Old 06-05-2013, 06:49 PM
Tim_Rocks Tim_Rocks is offline
a true gentlemen
Tim_Rocks's Avatar
Join Date: Aug 2008
Location: USA
Posts: 1,863
Tim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to behold
In the future I'd try using PHP and http://www.fp4.ca/gs2beautifier/ before posting on the forums. Makes it a lot easier to read.

PHP Code:
// Weapons Script for PB (PLANET BASE) 
// MADE BY: Take(Defaultaccount),Delta(),

//#CLIENTSIDE
function onEquip() {
  
this.equiped true;
  
freezeplayer(this.equip);
  
setani(this.equip2null);
  
replaceani("walk"this.walk);
  
replaceani("idle"this.idle);
}

function 
onCreated() {
  
this.spread 0.00// Controls the spread of weapon
  
this.speed 0.2// Controls the fire rate of weapon
  
this.reload 0.1// Controls the reload of the weapon
  
this.freeze 0.05// Controls the freeze of the weapon
  
this.equip 0.5// Controls the equip time of the weapon
  
this.bspeed 1// Controls the speed of the bullet
  
this.bulletangle = -.5// Controls the angle of the bullet

  
disableweapon(sword);

  
setani(this.idlenull);
  
this.walk "pb_mp5navy-walk";
  
this.idle "pb_mp5navy-idle";
  
this.ewalk "pb_mp5navy-unequiped-walk";
  
this.eidle "pb_mp5navy-unequiped-idle";
  
this.equip2 "pb_mp5navy-equip";
  
this.unequip "pb_mp5navy-unequip";
  
this.fire "pb_mp5navy-fire";
  
this.reload2 "pb_mp5navy-unequip";
}

function 
GraalControl.onKeyUp(codekeyscan) {
  if (
key == "a") {
    
freezeplayer(this.reload);
    
setani(this.reload2null);
  }
  if (
key == "f") {
    
setani(this.unequipnull);
    
replaceani("walk"this.ewalk);
    
replaceani("idle"this.eidle);
    
freezeplayer(this.equip);
    
this.equiped false;
  }
  if (
key == "s") {
    
this.equiped false;
    
replaceani("walk""walk");
    
replaceani("idle""idle");
    return;
  }
  if (
key == "d") {
    if (
this.equiped true) {
      
setani(this.firenull);
      
freezeplayer(this.freeze);
      
this.angle getangle(vecx(playerdir), vecy(playerdir));
      
setshootparams(player.account);
      
shoot(player..3player..3player.zthis.angle random(this.bulletangleabs(this.bulletangle)), 00"pb_bullet1""pb_bullet1.png");
      if (
this.equiped false) {
        
onEquip();
      }
    }
  }
}

function 
onActionProjectile() {
  
player.hearts = -.5;

I am curious to know why you're using

PHP Code:
function GraalControl.onKeyUp(codekeyscan) {
  
//Key up..

Instead of
PHP Code:
function GraalControl.onKeyDown(codekeyscan) {
  
//Key Down..

Although I'm not sure what your issue is without testing it later.
__________________
Reply With Quote