View Single Post
  #2  
Old 02-11-2010, 12:36 PM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Quote:
Originally Posted by scriptless View Post
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.+ (vecx(player.dir) * 2) + 1.5player.+ (vecy(player.dir) * 2) + 1.8};
  
triggeractionar[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.
Reply With Quote