Jump to content
Sign in to follow this  
twisted

noob question.convert a call for use in mpaddvenethandler

Recommended Posts

i just cont figure this out for some reason.

i want to take

_nada2 = [_x] call tws_simpleRearm;

and pass it as an addmpeventhandler in the case of the unit being killed.

_x addMPEventHandler ["mpkilled", "tws_nada2 = [_this] call tws_simpleRearm;"];

the variable being looped through in the foreach is allunits

i keep getting an error message

i think im getting sqf scope mixed up again.

Share this post


Link to post
Share on other sites

try

_x addMPEventHandler ["mpkilled", {tws_nada2 = [_this] call tws_simpleRearm;}];

Edited by Benargee

Share this post


Link to post
Share on other sites
try

_x addMPEventHandler ["mpkilled", "{tws_nada2 = [_this] call tws_simpleRearm;}"];

If you have the braces the outer quotes are redundant.

Also, I believe if there is any sort of suspension within the function itself, you will need to spawn the call to function inside the EH.

Edited by JShock

Share this post


Link to post
Share on other sites

nice, thanks for that. SQFs sure have many different intricacies.

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
Sign in to follow this  

×