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(cmd, account, weapon) {
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(account, weapon) {
triggerServer("gui", this.name, "attack", account, weapon);
}