View Single Post
  #1  
Old 09-19-2010, 02:02 PM
iSlayer iSlayer is offline
Snk for manager
iSlayer's Avatar
Join Date: Feb 2010
Location: Room 7, Era Hotel, Era
Posts: 202
iSlayer will become famous soon enough
Equip/Unequip Weapons

Nearly ready for release, but my server can't be released without the option to equip/unequip, I gave it a shot but I press D, it switchs to punch, i punch then i press S again and the player attacks with an invisible sword??

Weapons/Test D Unequip
PHP Code:
thiso.weapontabs = {"Weapons"};
this.image "pa_mud-maceofthedead.png";   

function 
onActionServerside(option) {
  if (
temp.option == "onAttack") {
  
  
player.doAttack("Sword"62player.account);
}
 if (
temp.option == "equip") {
 
clientr.mudweapon this.name;
 echo(
"Weapon Equiped");
}
 if (
temp.option == "unequip") {
 
clientr.mudweapon "+Fists/Punch";
 echo(
"Weapon Unequiped");
}
}
//#CLIENTSIDE
function GraalControl.onKeyDown(codekey) {
    if (
key == "s" && player.weapon == this && ! this.&& clientr.mudweapon != this.name) {
    
this.true;
    
player.attr[2] = "pa_mace-ofthedead.png";
    
triggerserver("gui"this.name"equip");
    }
    if (
key == "s" && player.weapon == this && ! this.&& clientr.mudweapon == this.name) {
    
this.onTimeOut();
    
this.true;
    }
    if (
key == "d" && player.weapon == this && ! this.&& clientr.mudweapon == this.name) {
     
triggerserver("gui"this.name"unequip");   
   }
  }
    
  function 
onTimeOut() {
  if (
player.weapon != this) {
    return;
  }
  
setani("pa_maceattack"""); 
  
freezeplayer(0.25); 
  
triggerserver("weapon"this.name"onAttack");
  
replaceani("pa_scythewalk","pa_macewalk");
  
replaceani("pa_scytheidle","pa_maceidle");
  
  
  if (
this.isAutomatic) {
    
this.setTimer(this.sleepTime);
  }
}

function 
GraalControl.onKeyUp(codekey) {
  if (
key == "s" && player.weapon == this && clientr.mudweapon == this.name) {
    
this.setTimer(0);
    
this.false;
  }

+Fists/Punch
PHP Code:
function onActionServerside(option) {
  if (
temp.option != "onAttack") return;
  
  
player.doAttack("Punch"11);
}

//#CLIENTSIDE

function GraalControl.onKeyDown(codekey) {
  if (
key == "s" && ! this.&& clientr.mudweapon == this) {
    
this.onTimeOut();
    
this.true;
    
player.attr[2] = "";
  }
}

function 
onTimeOut() {
  
setani("pa_punch"""); 
  
freezeplayer(0.25); 
  
triggerserver("weapon"this.name"onAttack");
  
  
  if (
this.isAutomatic) {
    
this.setTimer(this.sleepTime);
  }
}

function 
GraalControl.onKeyUp(codekey) {
  if (
key == "s" && clientr.mudweapon == this) {
    
this.setTimer(0);
    
this.false;
  }

__________________
Snk for manager




Quote:
Originally Posted by Admins View Post
Snk for manager of Era
Reply With Quote