10-18-2011, 02:47 PM
No to multiple things:
2. grp has to be the name of the unit you want to add the eventhandler to or you have to use something like:
This will add the eventhandler to all units present in the mission; allUnits in the biki.
I suggest you start with a more simple setup for your mission because I can tell you that scripting multiplayer missions is particularly complicated to get right. Start with basic attack/defend missions with minimal scripting and work your way up from there.
Quote:grp addmpeventhandler ["killed", text "a friendly has died"]1. with addMPEventHandler you have to use the corresponding eventhandler types, so instead of "killed" you have to use "MPKilled", see biki for reference.
2. grp has to be the name of the unit you want to add the eventhandler to or you have to use something like:
Code:
{_x addMPEventHandler ["MPKilled", _this execVM "killed.sqf"]} forEach allUnits;
I suggest you start with a more simple setup for your mission because I can tell you that scripting multiplayer missions is particularly complicated to get right. Start with basic attack/defend missions with minimal scripting and work your way up from there.