Quote:
Originally Posted by scriptless
I am curious as to how I would use a triggeraction to trigger an action in a joined class? Or is this not possible?
Class:
PHP Code:
//#CLIENTSIDE public function onActionHurt(acct) { player.hearts -= 0.5; player.chat = "hurt by" SPC acct; setani( "human2_hurt", NULL); }
Weapon:
PHP Code:
//#CLIENTSIDE function onCreated() { player.join("hurt"); } function onKeyPressed() { ar = {player.x + (vecx(player.dir) * 2) + 1.5, player.y + (vecy(player.dir) * 2) + 1.8}; triggeraction( ar[0], ar[1], "Hurt", player.account); }
I have 2 accounts logged in. But only 1 account can hit the other. Is there any reason for this?
|
While triggeraction can be used to trigger directly to the clients of players at a given coordinate I don't believe this is possible no, I believe they have to be recieved within weapons.
I'd suggest moving the "onActionHurt" into a weapon, but then simply calling a player.injured() or whatever in it's place within the class once recieved.