Here's the thing - I really, really hate the triggeraction(targetx+1.5,targety+1.5,hit,2); technique. What happens if the target's lagging? What happens if he moves between the point that you had him lined up in your sites and took the shot and the point that the action triggers on his spot?
And yet I find myself with a script that's almost finished - except that the previous scripter used triggeraction. I've got a whole beautiful
(not elegant, I don't do elegant) subroutine for detecting which players are about to get hit and storing their names, and I've got a whole beautiful loop for picking each one and hitting them...but because I'm not writing
(guessing) it Exactly Right, it doesn't do a damn thing.
Here's what I got:
PHP Code:
//#CLIENTSIDE
function onActionMelee() {
player.chat=("Hit! "@params[0] SPC params[1]);
setAni("hurt", "");
if(this.cooldown<1){
triggerserver("gui", this.name, "hurt", params[0], params[1]);
findWeapon("GUIInventory").trigger("showHUD", "");
this.cooldown=60;
}
}
which works fine (but only for triggeraction x y), and
PHP Code:
with(findplayer(plr)){
// echo("Found "@plr SPC ani);
setAni("hurt", "");
triggerserver("gui", "#HP", "hurt", "other", temp.dmg);
this.findWeapon("#HP").trigger("Melee", "other", "3");
this.findWeapon("#HP").trigger("ActionMelee", "other", "3");
this.findWeapon("#HP").trigger("OnActionMelee", "other", "3");
this.findWeapon("#HP").melee("other", "3");
this.findWeapon("#HP").Melee("other", "3");
this.findWeapon("#HP").ActionMelee("other", "3");
this.findWeapon("#HP").actionmelee("other", "3");
this.findWeapon("#HP").onactionmelee("other", "3");
this.findWeapon("#HP").OnActionMelee("other", "3");
}
(also clientside); to reiterate, isn't there some sort of player.trigger(wossname)?