Jump to content

Dead body marker


Sneer

Recommended Posts

I found this arma2 script for marking dead bodies on the map, but it doesn't work on arma3, anyone want to try to update it so it does?

 

Spoiler

while {true} do {
    if (visibleMap || (!isNull (findDisplay 88890))) then {
        {
            if (!isNull _x) then {
                _name = _x getVariable["bodyName","unknown"];
                if (_name == name player) then {_name = "My body";};
                _pPos = getPosATL _x;
                _nameID = _name + str(_pPos);
                if (_name == "My body") then {
                    deleteMarkerLocal _nameID;
                    _mrkr = createMarkerLocal [_nameID,_pPos];
                    _mrkr setMarkerTypeLocal "DestroyedVehicle";
                    _mrkr setMarkerTextLocal format ["%1",_name];
                    _mrkr setMarkerColorLocal "ColorRed";
                } else {
                    deleteMarkerLocal _nameID;
                };
            };
        } count allDead;
    };
    uiSleep 2;
};

 

Link to comment
Share on other sites

I'm not sure, but I believe Arma don't remember the last Player Name of dead bodys.

So it is needed to set the variable "bodyName" first on the Body.

You can do this Clientside on login, with a eventhandler "killed" or Serverside on login / killed.

The best way to do this is serverside, or you have to add a BE-Filter for the Setvariable.

I would do this in the moment of a kill in the "EPOCH_server_deadPlayer". This function already include the Playername.

Spoiler

private ["_triggerType","_veh","_bankBalance","_bankData","_response","_playerUID","_pos","_cIndex","_vars","_current_crypto"];
params ["_playerObj","_killer","_playerName",["_token","",[""]]];

// handle token check and isnull for _player
if !([_playerObj, _token] call EPOCH_server_getPToken) exitWith{};
_playerObj setvariable ['bodyName',_playerName,true];
...

 

Link to comment
Share on other sites

  • 3 months later...
  • 2 months later...

Did you manage to make it working @Sneer?

I added the variable as @He-Man mentioned and tried two versions of marker scripts but both failed. If anyone could give me a hand id be very happy :)

 

Script 1:

Spoiler

private ["_bodyCount","_marker","_name","_pos"];


while {true} do {
        
        if (visibleMap) then {        
                _bodyCount = 0;
                _name = name player;
                {
                    if (_x getVariable["bodyName",""] == _name) then {
                        _pos = visiblePosition _x;
                        if (_pos select 2 >= 0) then { //Body is not hidden
                            _bodyCount = _bodyCount + 1;
                            deleteMarkerLocal format["MyBody%1",_bodyCount];
                            _marker = createMarkerLocal [format["MyBody%1",_bodyCount],_pos];
                            _marker setMarkerTypeLocal "mil_dot";
                            _marker setMarkerTextLocal format ["%1",_name];
                            _marker setMarkerColorLocal "ColorRed";
                        }
                        else 
                        {
                        deleteMarkerLocal format["MyBody%1",_bodyCount];
                        };
                    };
                } count allDead;        
            };
            uiSleep 2;
        };

 

Error Message Script 1:

Spoiler

 8:28:20 Error in expression <er;
{
if (_x getVariable["bodyName",""] == _name) then {
_pos = visiblePosition >
 8:28:20   Error position: <== _name) then {
_pos = visiblePosition >
 8:28:20   Error ==: Typ Array, erwartet Zahl,Zeichenfolge,Keine Zahl,Objekt,Seite,Gruppe,Text,Config entry,Display (dialog),Control,Network Object,Team member,Task,Location

 

 

Script 2:

Spoiler

while {true} do {
    if (visibleMap) then {
        {
            if (!isNull _x) then {
                _name = _x getVariable["bodyName","unknown"];
                if (_name == name player) then {_name = "My body";};
                _pPos = getPosATL _x;
                _nameID = _name + str(_pPos);
                if (_name == "My body") then {
                    deleteMarkerLocal _nameID;
                    _mrkr = createMarkerLocal [_nameID,_pPos];
                    _mrkr setMarkerTypeLocal "mil_dot";
                    _mrkr setMarkerTextLocal format ["%1",_name];
                    _mrkr setMarkerColorLocal "ColorRed";
                } else {
                    deleteMarkerLocal _nameID;
                };
            };
        } count allDead;
    };
    uiSleep 2;
};

 

Error Message Script 2:

Spoiler

 8:44:44 Error in expression <riable["bodyName","unknown"];
if (_name == name player) then {_name = "My body";>
 8:44:44   Error position: <== name player) then {_name = "My body";>
 8:44:44   Error ==: Typ Array, erwartet Zahl,Zeichenfolge,Keine Zahl,Objekt,Seite,Gruppe,Text,Config entry,Display (dialog),Control,Network Object,Team member,Task,Location

 

Link to comment
Share on other sites

On 9/1/2017 at 2:53 AM, Drokz said:

Did you manage to make it working @Sneer?

I added the variable as @He-Man mentioned and tried two versions of marker scripts but both failed. If anyone could give me a hand id be very happy :)

 

Script 1:

  Hide contents

private ["_bodyCount","_marker","_name","_pos"];


while {true} do {
        
        if (visibleMap) then {        
                _bodyCount = 0;
                _name = name player;
                {
                    if (_x getVariable["bodyName",""] == _name) then {
                        _pos = visiblePosition _x;
                        if (_pos select 2 >= 0) then { //Body is not hidden
                            _bodyCount = _bodyCount + 1;
                            deleteMarkerLocal format["MyBody%1",_bodyCount];
                            _marker = createMarkerLocal [format["MyBody%1",_bodyCount],_pos];
                            _marker setMarkerTypeLocal "mil_dot";
                            _marker setMarkerTextLocal format ["%1",_name];
                            _marker setMarkerColorLocal "ColorRed";
                        }
                        else 
                        {
                        deleteMarkerLocal format["MyBody%1",_bodyCount];
                        };
                    };
                } count allDead;        
            };
            uiSleep 2;
        };

 

Error Message Script 1:

  Hide contents

 8:28:20 Error in expression <er;
{
if (_x getVariable["bodyName",""] == _name) then {
_pos = visiblePosition >
 8:28:20   Error position: <== _name) then {
_pos = visiblePosition >
 8:28:20   Error ==: Typ Array, erwartet Zahl,Zeichenfolge,Keine Zahl,Objekt,Seite,Gruppe,Text,Config entry,Display (dialog),Control,Network Object,Team member,Task,Location

 

 

Script 2:

  Hide contents

while {true} do {
    if (visibleMap) then {
        {
            if (!isNull _x) then {
                _name = _x getVariable["bodyName","unknown"];
                if (_name == name player) then {_name = "My body";};
                _pPos = getPosATL _x;
                _nameID = _name + str(_pPos);
                if (_name == "My body") then {
                    deleteMarkerLocal _nameID;
                    _mrkr = createMarkerLocal [_nameID,_pPos];
                    _mrkr setMarkerTypeLocal "mil_dot";
                    _mrkr setMarkerTextLocal format ["%1",_name];
                    _mrkr setMarkerColorLocal "ColorRed";
                } else {
                    deleteMarkerLocal _nameID;
                };
            };
        } count allDead;
    };
    uiSleep 2;
};

 

Error Message Script 2:

  Hide contents

 8:44:44 Error in expression <riable["bodyName","unknown"];
if (_name == name player) then {_name = "My body";>
 8:44:44   Error position: <== name player) then {_name = "My body";>
 8:44:44   Error ==: Typ Array, erwartet Zahl,Zeichenfolge,Keine Zahl,Objekt,Seite,Gruppe,Text,Config entry,Display (dialog),Control,Network Object,Team member,Task,Location

 

No I gave up. lol

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...