View Single Post
  #5  
Old 04-02-2010, 08:40 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Usually it's best to just send the account of the attacker and the weapon they're using if you're using a clientside melee system since they can change the damage to whatever they want. For example,

PHP Code:
function onActionServerSide(cmdaccountweapon) {
  if (
cmd == "attack") {
    
temp.pl findPlayer(account);
    if (
pl == null) {
      return; 
// attacker is offline
    
}
    if (! 
pl.hasWeapon(weapon)) { // replace this to match your server's item/weapon structure
      
return; // they don't have the weapon
    
}
    
    
temp.damage DB_Damage.getDamage(weapon);
    
player.hit(damage);
  }
}

//#CLIENTSIDE
function onActionPlayerHit(accountweapon) {
  
triggerServer("gui"this.name"attack"accountweapon);

__________________
Reply With Quote