Jump to content
Sign in to follow this  
1para{god-father}

Some help on my addEventHandler

Recommended Posts

OK I have added the below to my ALICE Module and it works great. i.e if executes civideath.sqf and generates a score. But i need it to only add up the score if Bluefore kill the Civi not OPFOR thuis is the bit io cannot get top work , but i get no error ?

Working

_ALICE setVariable [ "ALICE_civilianinit", [{_this addEventHandler ["Killed", {_this execVM "civilians\civdeath.sqf";totalscore = totalscore -50;} ]; }] ];

not working - no error no Civilians even spawn in ? anyone spot the error ?

_ALICE setVariable [ "ALICE_civilianinit", [{_this addEventHandler ["Killed", {if (isPlayer (_this select 1) AND side (_this select 1) == WEST ) then {totalscore = totalscore -50};_this execVM 'civilians\civdeath.sqf';} ]; }] ];

Share this post


Link to post
Share on other sites

_this addEventHandler ["Killed", {if (isPlayer (_this select 1) AND side (_this select 1) == WEST ) then {totalscore = totalscore -50 [color="#FF0000"] excess }[/color];_this execVM 'civilians\civdeath.sqf';} [color="#FF0000"]missing }[/color] ];

the evenhandler statement isn't correct, one } is missing and one } is in excess :

_this addEventHandler ["Killed", {if (isPlayer (_this select 1) AND side (_this select 1) == WEST ) then {totalscore = totalscore -50;_this execVM 'civilians\civdeath.sqf';} } ];

Edited by ProfTournesol

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  

×