Jump to content

Recommended Posts

I'm trying to create a MedEvac vic that would heal anyone entering it's cargo for a multiplayer scenario. I planned on looking into Event Handlers to achieve that.
As far as my dumb a$$ understands wiki, puting this in the init field of the vic should be enough

this addEventHandler ["GetIn", {_cargo call ace_medical_treatment_fnc_fullHealLocal}]; 

But it's obviously is not since I'm posting. Could anyone point me as to where I made a mistake?

Share this post


Link to post
Share on other sites

_cargo is not defined.

For any EH, always check the available parameters for the inner code.

https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#GetIn

 

Not mandatory to use them all, but the index is. You can also use your own local variable name. Here:
 

this addEventHandler ["GetIn", {
  params ["", "_role", "_wounded"];
  if (_role == "cargo") then {_wounded call ace_medical_treatment_fnc_fullHealLocal};
}];

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Ahhh so that's how it works 😄 I just wrongly assumed EH would do it for me 🤦‍♂️
Thank You for the explanation

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×