in init.sqf :
Say you are on SP mission. In MP, the code is slightly different:
{
_x addEventHandler ["killed", {
_victim = _this select 0;
_mark = createMarkerLocal [name _victim,getPosATL _victim];
_mark setMarkerTypeLocal "selector_selectable"; // or what [url=https://community.bistudio.com/wiki/cfgMarkers]type you want[/url]
_mark setMarkerText "walking dead";
_mark setMarkerColor "colorRed";
}]
} forEach (allUnits select {(side _x) getFriend player < 0.6});
If you spawn units in game, as this code runs at start, you need to loop it to actualize allUnits variable:
0 = [] spawn {
while {true} do {
sleep 5;
{
if !(_x getVariable ["marked",false]) then {
_x setVariable ["marked",true];
_x addEventHandler ["killed", {
_victim = _this select 0;
_mark = createMarkerLocal [name _victim,getPosATL _victim];
_mark setMarkerTypeLocal "selector_selectable"; // or what [url=https://community.bistudio.com/wiki/cfgMarkers]type you want[/url]
_mark setMarkerText "walking dead";
_mark setMarkerColor "colorRed";
}];
};
} forEach (allUnits select {(side _x) getFriend player < 0.6});
};
};