View Single Post
  #7  
Old 11-05-2009, 03:31 PM
Liberated Liberated is offline
not doing alot
Liberated's Avatar
Join Date: Feb 2008
Posts: 1,366
Liberated has a spectacular aura about
ah thanks, hopefully it will work now

edit: so far so good,
only 1 problem, my gun always fires when i press D, and my script to turn it on/off doesn't respond at all.
PHP Code:
//#CLIENTSIDE

function onWeaponFired()
{
  if(
temp.equip == 0)
  {
    
shoot(player.1.5 vecx(player.dir), player.vecy(player.dir), player.z-1, (playerdir 1) * pi 2NULLNULL"arrow"NULL);
    
setani("era_deagle-fire"NULL);
    
replaceAni("idle""era_deagle-idle");
    
replaceAni("walk""era_deagle-walk");
    
freezeplayer(0.1);
  }
  else
  {
  
player.chat "hi";
  }
}
function 
onActionProjectile()
{
  
player.hearts -= 2;
}  
function 
onKeyPressed()
{
  if (
keydown(5))
  {
    if(
temp.equip == 1)
    {
      
setani("era_deagle-reload");
      
replaceani("idle""era_deagle-idle");
      
replaceani("walk""era_deagle-walk");
      
temp.equip 0;
    }

    else
    {
      
replaceAni("idle""idle");
      
replaceAni("walk""walk");
      
temp.equip 1;
    }
  }

editedit:
actually it does turn it off, but not on, and it also slashes my sword so i need to find a fix for that.

editeditedit: Yay got it working, thanks for the help! I also played a bit with the shoot settings, i now get how they work.
PHP Code:
//#CLIENTSIDE
function onKeyPressed()
{
  if (
keydown(6))
  {
    
this.equip this.equip;
    
    if (
this.equip == NULL)
    {
      
replaceAni("idle""idle");
      
replaceAni("walk""walk");
      
setani("walk");
    }
    else
    {
      
setani("era_deagle-reload");
      
replaceAni("idle""era_deagle-idle");
      
replaceAni("walk""era_deagle-walk");
    }
  }
}
function 
onWeaponFired()
{
  if(
this.equip == 1)
  {
    
shoot(player.0.5 vecx(player.dir), player.vecy(player.dir), player.z-1, (playerdir 1) * pi 2NULLNULL"arrow"NULL);
    
setani("era_deagle-fire"NULL);
    
freezeplayer(0.1);
  }
  else
  {
  
player.chat "no gun equiped";
  }
}
function 
onActionProjectile()
{
  
player.hearts -= 2;

__________________
Quote:
Originally Posted by Tigairius View Post
I promise when I get rich I'll send you an iPhone. I'll send everyone an iPhone.

Last edited by Liberated; 11-05-2009 at 04:08 PM..
Reply With Quote