Jump to content
Sign in to follow this  
malick

Some troubles with addEventHandler

Recommended Posts

Hi all,

I just restarted scripting for a mission and I encounter some troubles using addeventhandler command.

I want all units in a group to fire a script when they are killed.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{_x addEventHandler ["Killed", {_this exec {friendly\killed.sqs}}]} forEach units player_group

But an error message tells me that a ; is missing before the forEach command.

I also tried another syntax that I already used in OFP, with no better results:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"_x addEventHandler [""Killed"", {_this exec {friendly\killed.sqs}}]" forEach units player_group

Has anyone got an idea ?

Thanks

Malick

Share this post


Link to post
Share on other sites

Hi,

try

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{_x addEventHandler ["Killed", {_this exec "friendly\killed.sqs"}]} forEach units player_group

Regards,

Baddo.

Share this post


Link to post
Share on other sites

Thanks Baddo, it works.

I thought I had tried this syntax already, but it seems not wink_o.gif

Malick

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  

×