Jump to content

[Release] Custom Kill Messages


0verHeaT

Recommended Posts

Possible Deathboard Fix

 

player_murderMenu.sqf

EpochDeathBoardLoad = {
	createdialog "EpochDeathBoardDialog";
	{
		private ["_index"];
		_index = lbAdd [21000,_x select 0];
	} count PV_DeathBoard;
};

EpochDeathBoardClick = {
	disableSerialization;
	private ["_index","_record","_output","_record_stxt","_name","_image","_h","_m","_format","_victim","_attacker","_time","_distance"];
		_quotes = [
			"Death is God's way of telling you not to be such a wise guy.",
			"What happens if you get scared half to death, twice?",
			"Don't upset me.. I'm running out of places to hide the bodies.",
			"Don't run, you'll just die tired.",
			"Give me immortality || give me death.",
			"I can't live with death; he's always leaving the toilet seat up.",
			"Why won't you die?!?!",
			"Guns don't kill people; death kills people. It's a proven medical fact."
		];
	_index = _this select 0;
	if (_index < 0) exitWith {};
	_output = _this select 1;
	_record = PV_DeathBoard select _index;

	_victim = _record select 0;
	_attacker = _record select 1;
	_name = _record select 2;
	_image = _record select 3;
	_distance = _record select 4;
	_time = _record select 5;

	if (isNil "_victim" || isNil "_attacker" || isNil "_name" || isNil "_distance" || isNil "_time") exitWith {_output ctrlSetStructuredText parseText "<br/><br/><br/><br/><t size='1.6' align='center'>There are some information missing for this entry</t>";};

	_format = {
		private ["_codeCount","_str"];
		_str = format["%1", _this];
		_codeCount = (count (toArray _str));
		if (_codeCount == 1) then {_str = format["0%1", _str];	};
		_str;
	};
	_h = (_time select 0) + timezoneswitch;
	_m = _time select 1;

	_record_stxt = format["<t size='1.6' align='left'>%1</t><br/><br/>",_victim];
	_record_stxt = _record_stxt + format["<t size='1' align='left'>Died at %1:%2</t><br/><br/>",(_h call _format),(_m call _format)];
	_record_stxt = _record_stxt + format["<t size='1' align='left'>Was killed by %1</t><br/><br/>",_attacker];
	_record_stxt = _record_stxt + format["<t size='1' align='left'>With a %1<br/><img size='3' image='%2' /></t><br/><br/>",_name,_image];
	_record_stxt = _record_stxt + format["<t size='1' align='left'>At a distance of %1m</t><br/><br/>",_distance];
	_record_stxt = _record_stxt + format["<t font='Bitstream'>%1</t>",(_quotes call BIS_fnc_selectRandom)];

	_output ctrlSetStructuredText parseText _record_stxt;
}; 

server_playerDied.sqf

_death_record = [
	_victimName,
	_killerName,
	_weapon,
	_pic,
	_distance,
	ServerCurrentTime
];
PlayerDeaths set [count PlayerDeaths,_death_record];
PV_DeathBoard = PlayerDeaths;
publicVariable "PV_DeathBoard"; 

can I just slap that on the end of the playerdied.sqf or is placement important?

Link to comment
Share on other sites

this only appears for me if player who died is using skin Survivor2_DZ or Bandit2_DZ, i tested with a friend and when player who died is using sniper1_dz for exemple...

"custom kill msg" will not show.

 

*already using "steamROLLER" fix:

Add a 3 second delay sleep 3; above the following
_killer = _victim getVariable["AttackedBy", "nil"];
_killerName = _victim getVariable["AttackedByName", "nil"];

*already using  player_murderMenu.sqf  Possible Deathboard Fix by 0verHeat (idk what is this, but i'm using)

 

someone can give me a hand?

Link to comment
Share on other sites

this only appears for me if player who died is using skin Survivor2_DZ or Bandit2_DZ, i tested with a friend and when player who died is using sniper1_dz for exemple...

"custom kill msg" will not show.

 

*already using "steamROLLER" fix:

Add a 3 second delay sleep 3; above the following
_killer = _victim getVariable["AttackedBy", "nil"];
_killerName = _victim getVariable["AttackedByName", "nil"];

*already using  player_murderMenu.sqf  Possible Deathboard Fix by 0verHeat (idk what is this, but i'm using)

 

someone can give me a hand?

did you really put

"add a 3 second delay sleep 3; above the following"

in the code?

Cause if you did that would be your problem right there lol.

 

The bold word is what you're supposed to add, he's just explaining it in text. Immediately below the explanation is the entire file, you can literally just copy paste that file over your existing one, or use it as a reference.

Link to comment
Share on other sites

Possible Deathboard Fix

 

player_murderMenu.sqf

EpochDeathBoardLoad = {
	createdialog "EpochDeathBoardDialog";
	{
		private ["_index"];
		_index = lbAdd [21000,_x select 0];
	} count PV_DeathBoard;
};

EpochDeathBoardClick = {
	disableSerialization;
	private ["_index","_record","_output","_record_stxt","_name","_image","_h","_m","_format","_victim","_attacker","_time","_distance"];
		_quotes = [
			"Death is God's way of telling you not to be such a wise guy.",
			"What happens if you get scared half to death, twice?",
			"Don't upset me.. I'm running out of places to hide the bodies.",
			"Don't run, you'll just die tired.",
			"Give me immortality || give me death.",
			"I can't live with death; he's always leaving the toilet seat up.",
			"Why won't you die?!?!",
			"Guns don't kill people; death kills people. It's a proven medical fact."
		];
	_index = _this select 0;
	if (_index < 0) exitWith {};
	_output = _this select 1;
	_record = PV_DeathBoard select _index;

	_victim = _record select 0;
	_attacker = _record select 1;
	_name = _record select 2;
	_image = _record select 3;
	_distance = _record select 4;
	_time = _record select 5;

	if (isNil "_victim" || isNil "_attacker" || isNil "_name" || isNil "_distance" || isNil "_time") exitWith {_output ctrlSetStructuredText parseText "<br/><br/><br/><br/><t size='1.6' align='center'>There are some information missing for this entry</t>";};

	_format = {
		private ["_codeCount","_str"];
		_str = format["%1", _this];
		_codeCount = (count (toArray _str));
		if (_codeCount == 1) then {_str = format["0%1", _str];	};
		_str;
	};
	_h = (_time select 0) + timezoneswitch;
	_m = _time select 1;

	_record_stxt = format["<t size='1.6' align='left'>%1</t><br/><br/>",_victim];
	_record_stxt = _record_stxt + format["<t size='1' align='left'>Died at %1:%2</t><br/><br/>",(_h call _format),(_m call _format)];
	_record_stxt = _record_stxt + format["<t size='1' align='left'>Was killed by %1</t><br/><br/>",_attacker];
	_record_stxt = _record_stxt + format["<t size='1' align='left'>With a %1<br/><img size='3' image='%2' /></t><br/><br/>",_name,_image];
	_record_stxt = _record_stxt + format["<t size='1' align='left'>At a distance of %1m</t><br/><br/>",_distance];
	_record_stxt = _record_stxt + format["<t font='Bitstream'>%1</t>",(_quotes call BIS_fnc_selectRandom)];

	_output ctrlSetStructuredText parseText _record_stxt;
}; 

server_playerDied.sqf

_death_record = [
	_victimName,
	_killerName,
	_weapon,
	_pic,
	_distance,
	ServerCurrentTime
];
PlayerDeaths set [count PlayerDeaths,_death_record];
PV_DeathBoard = PlayerDeaths;
publicVariable "PV_DeathBoard"; 

Still a bit confused, does this completely replace the murdermenu.sqf or only a section? For example do I need to get rid of the dialogs at the top?

 

EpochDeathBoardDialogList = 21000;
EpochDeathBoardDialogSText = 21001;
EpochDeathBoardDeaths = [];

and isnt' the whole thing missing a

 

};

at the end?

 

I tried adding this in, and it didnt work. So either Im doing this wrong or it doesn't work.

Link to comment
Share on other sites

Yes, replace your whole player_murdermenu.sqf with the code I posted under 'player_murdermenu.sqf'.

 

Remember to add/replace this to your server_playerDied.sqf

_death_record = [
	_victimName,
	_killerName,
	_weapon,
	_pic,
	_distance,
	ServerCurrentTime
];
PlayerDeaths set [count PlayerDeaths,_death_record];
PV_DeathBoard = PlayerDeaths;
publicVariable "PV_DeathBoard"; 
Link to comment
Share on other sites

did you really put

"add a 3 second delay sleep 3; above the following"

in the code?

Cause if you did that would be your problem right there lol.

 

The bold word is what you're supposed to add, he's just explaining it in text. Immediately below the explanation is the entire file, you can literally just copy paste that file over your existing one, or use it as a reference.

 

added sleep 4; to try and still not working if player died is sniper1_dz, with player Survivor2_DZ or Bandit2_DZ i dont have problems.

EJXgR9r.jpg

 

i need to add fixed kill msg??

Link to comment
Share on other sites

added sleep 4; to try and still not working if player died is sniper1_dz, with player Survivor2_DZ or Bandit2_DZ i dont have problems.

EJXgR9r.jpg

fnc_plyrHit.sqf

private ["_victim", "_attacker","_weapon","_weapon_dmg","_distance","_damage","_weapon_img"];
_victim = _this select 0;
_attacker = _this select 1;
_damage = _this select 2;

if (!isPlayer _victim || !isPlayer _attacker) exitWith {};
if ((owner _victim) == (owner _attacker)) exitWith {
    _victim setVariable["AttackedBy", _victim, true];
};

_weapon = (weaponState _attacker);

_vehicle = typeOf (vehicle _attacker);

if ((getText (configFile >> "CfgVehicles" >> _vehicle >> "vehicleClass")) in ["CarW","Car","CarD","Armored","Ship","Support","Air","ArmouredW","ArmouredD","SupportWoodland_ACR"]) then {
    _weapon_dmg = getText (configFile >> 'CfgVehicles' >> _vehicle >> 'displayName');
    _weapon_img = gettext(configFile >> 'CfgVehicles' >> _vehicle >> 'picture');
} else {
    _weapon_dmg = gettext (configFile >> 'cfgWeapons' >> (currentWeapon _attacker) >> 'displayName');
    _weapon_img = gettext(configFile >> 'cfgWeapons' >> (currentWeapon _attacker) >> 'picture');
};

_distance = _victim distance _attacker;

diag_log format["PLAYERHIT: %1 was hit by %2 with %3 from %4m with %5 dmg", _victim, _attacker, _weapon_dmg, _distance, _damage];

_victim setVariable["AttackedBy", _attacker, true];
_victim setVariable["AttackedByName", (name _attacker), true];
_victim setVariable["AttackedByWeapon", _weapon_dmg, true];
_victim setVariable["AttackedFromDistance", _distance, true];
_victim setVariable["AttackedByWeaponImg", _weapon_img, true];

 

server_playerDied.sqf

private ["_characterID","_minutes","_newObject","_playerID","_infected","_victim","_victimName","_killer","_killerName","_weapon","_distance","_message","_loc_message","_key","_death_record"];
//[unit, weapon, muzzle, mode, ammo, magazine, projectile]
_characterID =     _this select 0;
_minutes =        _this select 1;
_newObject =     _this select 2;
_playerID =     _this select 3;
_infected =        _this select 4;
if (((count _this) >= 6) && {(typeName (_this select 5)) == "STRING"} && {(_this select 5) != ""}) then {
    _victimName =    _this select 5;
} else {
    _victimName =  if (alive _newObject) then {name _newObject;} else {"";};
};
_victim = _newObject;
_newObject setVariable ["bodyName", _victimName, true];

sleep 3;

_killer = _victim getVariable["AttackedBy", "nil"];
_killerName = _victim getVariable["AttackedByName", "nil"];

// when a zombie kills a player _killer, _killerName && _weapon will be "nil"
// we can use this to determine a zombie kill && send a customized message for that. right now no killmsg means it was a zombie.
if ((typeName _killer) != "STRING") then
{
    _weapon = _victim getVariable["AttackedByWeapon", "nil"];
    _distance = _victim getVariable["AttackedFromDistance", "nil"];

    if ((owner _victim) == (owner _killer)) then
    {
        _message = format["%1 killed himself",_victimName];
        _loc_message = format["PKILL: %1 killed himself", _victimName];
    }
    else
    {
        _message = format["%1 was killed by %2 with weapon %3 from %4m",_victimName, _killerName, _weapon, _distance];
        _loc_message = format["PKILL: %1 was killed by %2 with weapon %3 from %4m", _victimName, _killerName, _weapon, _distance];
    
    
        _pic = _victim getVariable["AttackedByWeaponImg", "nil"];
        
                if ((gettext (configFile >> 'cfgWeapons' >> (currentWeapon _killer) >> 'displayName')) != "Throw") then {
            if (!isNil "_pic") then {
                _kill_txt = format ["<t align='left' size='0.7'>%1 </t>",_killerName,_pic,_victimName,(ceil _distance)];
                _kill_txt = _kill_txt + format ["<img size='0.9' align='left' image='%2'/>",_killerName,_pic,_victimName,(ceil _distance)];
                _kill_txt = _kill_txt + format ["<t align='left' size='0.7'> %3 </t>",_killerName,_pic,_victimName,(ceil _distance)];
                _kill_txt = _kill_txt + format ["<t align='left' size='0.7'>[%4m]</t>",_killerName,_pic,_victimName,(ceil _distance)];

                customkillMessage = [_kill_txt];
                publicVariable "customkillMessage";
            };
        };
    
    
    };

    diag_log _loc_message;

    if(DZE_DeathMsgGlobal) then {
        [nil, nil, rspawn, [_killer, _message], { (_this select 0) globalChat (_this select 1) }] call RE;
    };
    /* needs customRemoteMessage
    if(DZE_DeathMsgGlobal) then {
        customRemoteMessage = ['globalChat', _message, _killer];
        publicVariable "customRemoteMessage";
    };
    */
    if(DZE_DeathMsgSide) then {
        [nil, nil, rspawn, [_killer, _message], { (_this select 0) sideChat (_this select 1) }] call RE;
    };
    if(DZE_DeathMsgTitleText) then {
        [nil,nil,"per",rTITLETEXT,_message,"PLAIN DOWN"] call RE;
    };

    // build array to store death messages to allow viewing at message board in trader citys.
    _death_record = [
        _victimName,
        _killerName,
        _weapon,
        _distance,
        ServerCurrentTime
    ];
    PlayerDeaths set [count PlayerDeaths,_death_record];

    // Cleanup
    _victim setVariable["AttackedBy", "nil", true];
    _victim setVariable["AttackedByName", "nil", true];
    _victim setVariable["AttackedByWeapon", "nil", true];
    _victim setVariable["AttackedFromDistance", "nil", true];
};

// Might not be the best way...
/*
if (isnil "dayz_disco") then {
    dayz_disco = [];
};
*/

// dayz_disco = dayz_disco - [_playerID];
_newObject setVariable["processedDeath",diag_tickTime];

if (typeName _minutes == "STRING") then
{
    _minutes = parseNumber _minutes;
};

diag_log ("PDEATH: Player Died " + _playerID);

if (_characterID != "0") then
{
    _key = format["CHILD:202:%1:%2:%3:",_characterID,_minutes,_infected];
    #ifdef DZE_SERVER_DEBUG_HIVE
    diag_log ("HIVE: WRITE: "+ str(_key));
    #endif
    _key call server_hiveWrite;
}
else
{
    deleteVehicle _newObject;
};

 

kill_msg.sqf

/*** Written by 0verHeaT ***/
fnc_kill_message = {
    private ["_finaltxt"];
    _finaltxt = _this select 0;
    [_finaltxt,[safezoneX + 0.01 * safezoneW,2.0],[safezoneY + 0.01 * safezoneH,0.3],30,0.5] spawn BIS_fnc_dynamicText;
};
"customkillMessage" addPublicVariableEventHandler {(_this select 1) call fnc_kill_message;};

These are 100% working, if they dont work for you there is an issue somewhere else causing a conflict.

Link to comment
Share on other sites

fnc_plyrHit.sqf

private ["_victim", "_attacker","_weapon","_weapon_dmg","_distance","_damage","_weapon_img"];

_victim = _this select 0;

_attacker = _this select 1;

_damage = _this select 2;

if (!isPlayer _victim || !isPlayer _attacker) exitWith {};

if ((owner _victim) == (owner _attacker)) exitWith {

    _victim setVariable["AttackedBy", _victim, true];

};

_weapon = (weaponState _attacker);

_vehicle = typeOf (vehicle _attacker);

if ((getText (configFile >> "CfgVehicles" >> _vehicle >> "vehicleClass")) in ["CarW","Car","CarD","Armored","Ship","Support","Air","ArmouredW","ArmouredD","SupportWoodland_ACR"]) then {

    _weapon_dmg = getText (configFile >> 'CfgVehicles' >> _vehicle >> 'displayName');

    _weapon_img = gettext(configFile >> 'CfgVehicles' >> _vehicle >> 'picture');

} else {

    _weapon_dmg = gettext (configFile >> 'cfgWeapons' >> (currentWeapon _attacker) >> 'displayName');

    _weapon_img = gettext(configFile >> 'cfgWeapons' >> (currentWeapon _attacker) >> 'picture');

};

_distance = _victim distance _attacker;

diag_log format["PLAYERHIT: %1 was hit by %2 with %3 from %4m with %5 dmg", _victim, _attacker, _weapon_dmg, _distance, _damage];

_victim setVariable["AttackedBy", _attacker, true];

_victim setVariable["AttackedByName", (name _attacker), true];

_victim setVariable["AttackedByWeapon", _weapon_dmg, true];

_victim setVariable["AttackedFromDistance", _distance, true];

_victim setVariable["AttackedByWeaponImg", _weapon_img, true];

 

server_playerDied.sqf

private ["_characterID","_minutes","_newObject","_playerID","_infected","_victim","_victimName","_killer","_killerName","_weapon","_distance","_message","_loc_message","_key","_death_record"];

//[unit, weapon, muzzle, mode, ammo, magazine, projectile]

_characterID =     _this select 0;

_minutes =        _this select 1;

_newObject =     _this select 2;

_playerID =     _this select 3;

_infected =        _this select 4;

if (((count _this) >= 6) && {(typeName (_this select 5)) == "STRING"} && {(_this select 5) != ""}) then {

    _victimName =    _this select 5;

} else {

    _victimName =  if (alive _newObject) then {name _newObject;} else {"";};

};

_victim = _newObject;

_newObject setVariable ["bodyName", _victimName, true];

sleep 3;

_killer = _victim getVariable["AttackedBy", "nil"];

_killerName = _victim getVariable["AttackedByName", "nil"];

// when a zombie kills a player _killer, _killerName && _weapon will be "nil"

// we can use this to determine a zombie kill && send a customized message for that. right now no killmsg means it was a zombie.

if ((typeName _killer) != "STRING") then

{

    _weapon = _victim getVariable["AttackedByWeapon", "nil"];

    _distance = _victim getVariable["AttackedFromDistance", "nil"];

    if ((owner _victim) == (owner _killer)) then

    {

        _message = format["%1 killed himself",_victimName];

        _loc_message = format["PKILL: %1 killed himself", _victimName];

    }

    else

    {

        _message = format["%1 was killed by %2 with weapon %3 from %4m",_victimName, _killerName, _weapon, _distance];

        _loc_message = format["PKILL: %1 was killed by %2 with weapon %3 from %4m", _victimName, _killerName, _weapon, _distance];

    

    

        _pic = _victim getVariable["AttackedByWeaponImg", "nil"];

        

                if ((gettext (configFile >> 'cfgWeapons' >> (currentWeapon _killer) >> 'displayName')) != "Throw") then {

            if (!isNil "_pic") then {

                _kill_txt = format ["<t align='left' size='0.7'>%1 </t>",_killerName,_pic,_victimName,(ceil _distance)];

                _kill_txt = _kill_txt + format ["<img size='0.9' align='left' image='%2'/>",_killerName,_pic,_victimName,(ceil _distance)];

                _kill_txt = _kill_txt + format ["<t align='left' size='0.7'> %3 </t>",_killerName,_pic,_victimName,(ceil _distance)];

                _kill_txt = _kill_txt + format ["<t align='left' size='0.7'>[%4m]</t>",_killerName,_pic,_victimName,(ceil _distance)];

                customkillMessage = [_kill_txt];

                publicVariable "customkillMessage";

            };

        };

    

    

    };

    diag_log _loc_message;

    if(DZE_DeathMsgGlobal) then {

        [nil, nil, rspawn, [_killer, _message], { (_this select 0) globalChat (_this select 1) }] call RE;

    };

    /* needs customRemoteMessage

    if(DZE_DeathMsgGlobal) then {

        customRemoteMessage = ['globalChat', _message, _killer];

        publicVariable "customRemoteMessage";

    };

    */

    if(DZE_DeathMsgSide) then {

        [nil, nil, rspawn, [_killer, _message], { (_this select 0) sideChat (_this select 1) }] call RE;

    };

    if(DZE_DeathMsgTitleText) then {

        [nil,nil,"per",rTITLETEXT,_message,"PLAIN DOWN"] call RE;

    };

    // build array to store death messages to allow viewing at message board in trader citys.

    _death_record = [

        _victimName,

        _killerName,

        _weapon,

        _distance,

        ServerCurrentTime

    ];

    PlayerDeaths set [count PlayerDeaths,_death_record];

    // Cleanup

    _victim setVariable["AttackedBy", "nil", true];

    _victim setVariable["AttackedByName", "nil", true];

    _victim setVariable["AttackedByWeapon", "nil", true];

    _victim setVariable["AttackedFromDistance", "nil", true];

};

// Might not be the best way...

/*

if (isnil "dayz_disco") then {

    dayz_disco = [];

};

*/

// dayz_disco = dayz_disco - [_playerID];

_newObject setVariable["processedDeath",diag_tickTime];

if (typeName _minutes == "STRING") then

{

    _minutes = parseNumber _minutes;

};

diag_log ("PDEATH: Player Died " + _playerID);

if (_characterID != "0") then

{

    _key = format["CHILD:202:%1:%2:%3:",_characterID,_minutes,_infected];

    #ifdef DZE_SERVER_DEBUG_HIVE

    diag_log ("HIVE: WRITE: "+ str(_key));

    #endif

    _key call server_hiveWrite;

}

else

{

    deleteVehicle _newObject;

};

 

kill_msg.sqf

private ["_characterID","_minutes","_newObject","_playerID","_infected","_victim","_victimName","_killer","_killerName","_weapon","_distance","_message","_loc_message","_key","_death_record"];

//[unit, weapon, muzzle, mode, ammo, magazine, projectile]

_characterID =     _this select 0;

_minutes =        _this select 1;

_newObject =     _this select 2;

_playerID =     _this select 3;

_infected =        _this select 4;

if (((count _this) >= 6) && {(typeName (_this select 5)) == "STRING"} && {(_this select 5) != ""}) then {

    _victimName =    _this select 5;

} else {

    _victimName =  if (alive _newObject) then {name _newObject;} else {"";};

};

_victim = _newObject;

_newObject setVariable ["bodyName", _victimName, true];

sleep 3;

_killer = _victim getVariable["AttackedBy", "nil"];

_killerName = _victim getVariable["AttackedByName", "nil"];

// when a zombie kills a player _killer, _killerName && _weapon will be "nil"

// we can use this to determine a zombie kill && send a customized message for that. right now no killmsg means it was a zombie.

if ((typeName _killer) != "STRING") then

{

    _weapon = _victim getVariable["AttackedByWeapon", "nil"];

    _distance = _victim getVariable["AttackedFromDistance", "nil"];

    if ((owner _victim) == (owner _killer)) then

    {

        _message = format["%1 killed himself",_victimName];

        _loc_message = format["PKILL: %1 killed himself", _victimName];

    }

    else

    {

        _message = format["%1 was killed by %2 with weapon %3 from %4m",_victimName, _killerName, _weapon, _distance];

        _loc_message = format["PKILL: %1 was killed by %2 with weapon %3 from %4m", _victimName, _killerName, _weapon, _distance];

    

    

        _pic = _victim getVariable["AttackedByWeaponImg", "nil"];

        

                if ((gettext (configFile >> 'cfgWeapons' >> (currentWeapon _killer) >> 'displayName')) != "Throw") then {

            if (!isNil "_pic") then {

                _kill_txt = format ["<t align='left' size='0.7'>%1 </t>",_killerName,_pic,_victimName,(ceil _distance)];

                _kill_txt = _kill_txt + format ["<img size='0.9' align='left' image='%2'/>",_killerName,_pic,_victimName,(ceil _distance)];

                _kill_txt = _kill_txt + format ["<t align='left' size='0.7'> %3 </t>",_killerName,_pic,_victimName,(ceil _distance)];

                _kill_txt = _kill_txt + format ["<t align='left' size='0.7'>[%4m]</t>",_killerName,_pic,_victimName,(ceil _distance)];

                customkillMessage = [_kill_txt];

                publicVariable "customkillMessage";

            };

        };

    

    

    };

    diag_log _loc_message;

    if(DZE_DeathMsgGlobal) then {

        [nil, nil, rspawn, [_killer, _message], { (_this select 0) globalChat (_this select 1) }] call RE;

    };

    /* needs customRemoteMessage

    if(DZE_DeathMsgGlobal) then {

        customRemoteMessage = ['globalChat', _message, _killer];

        publicVariable "customRemoteMessage";

    };

    */

    if(DZE_DeathMsgSide) then {

        [nil, nil, rspawn, [_killer, _message], { (_this select 0) sideChat (_this select 1) }] call RE;

    };

    if(DZE_DeathMsgTitleText) then {

        [nil,nil,"per",rTITLETEXT,_message,"PLAIN DOWN"] call RE;

    };

    // build array to store death messages to allow viewing at message board in trader citys.

    _death_record = [

        _victimName,

        _killerName,

        _weapon,

        _distance,

        ServerCurrentTime

    ];

    PlayerDeaths set [count PlayerDeaths,_death_record];

    // Cleanup

    _victim setVariable["AttackedBy", "nil", true];

    _victim setVariable["AttackedByName", "nil", true];

    _victim setVariable["AttackedByWeapon", "nil", true];

    _victim setVariable["AttackedFromDistance", "nil", true];

};

// Might not be the best way...

/*

if (isnil "dayz_disco") then {

    dayz_disco = [];

};

*/

// dayz_disco = dayz_disco - [_playerID];

_newObject setVariable["processedDeath",diag_tickTime];

if (typeName _minutes == "STRING") then

{

    _minutes = parseNumber _minutes;

};

diag_log ("PDEATH: Player Died " + _playerID);

if (_characterID != "0") then

{

    _key = format["CHILD:202:%1:%2:%3:",_characterID,_minutes,_infected];

    #ifdef DZE_SERVER_DEBUG_HIVE

    diag_log ("HIVE: WRITE: "+ str(_key));

    #endif

    _key call server_hiveWrite;

}

else

{

    deleteVehicle _newObject;

};

These are 100% working, if they dont work for you there is an issue somewhere else causing a conflict.

 

something wrong with your kill_msg.sqf, or wrong kill_msg.sqf in this post.

Link to comment
Share on other sites

If the message does not show up, I would rather consider the fnc_plyrhit.sqf.

This is actually the reason why some kills are not displayed/logged because the player hit isn't detected right.

I don't know yet if this missing hit detection is caused by the EventHandler itself or if it's just lagg.

I already tried to use the EventHandler 'MPKilled', but this did not lead to a practical result either..

(cf. https://community.bistudio.com/wiki/ArmA_2:_Event_Handlers)

Link to comment
Share on other sites

If the message does not show up, I would rather consider the fnc_plyrhit.sqf.

This is actually the reason why some kills are not displayed/logged because the player hit isn't detected right.

I don't know yet if this missing hit detection is caused by the EventHandler itself or if it's just lagg.

I already tried to use the EventHandler 'MPKilled', but this did not lead to a practical result either..

(cf. https://community.bistudio.com/wiki/ArmA_2:_Event_Handlers)

It shows up fine if you put a sleep in the script and give it time to catch up. Its very similar to how my custom kill messages are on overwatch. I'd love to get a system chat message working in conjuction with it, so you see the picture and also get the system chat message which would allow you to scroll up in chat. The built in epoch ones only show a percentage of the time.

Link to comment
Share on other sites

If you want a systemChat message additionally

server_playerDied.sqf

_pic = _victim getVariable["AttackedByWeaponImg", "nil"];
		
if ((gettext (configFile >> 'cfgWeapons' >> (currentWeapon _killer) >> 'displayName')) != "Throw") then {
	if (_pic != "nil") then {
		_kill_txt = format ["<t align='left' size='0.9'>%1 </t>",_killerName,_pic,_victimName,(ceil _distance)];
		_kill_txt = _kill_txt + format ["<img size='1.0' align='left' image='%2'/>",_killerName,_pic,_victimName,(ceil _distance)];
		_kill_txt = _kill_txt + format ["<t align='left' size='0.9'> %3 </t>",_killerName,_pic,_victimName,(ceil _distance)];
		_kill_txt = _kill_txt + format ["<t align='left' size='0.9'>[%4m]</t>",_killerName,_pic,_victimName,(ceil _distance)];

		_msg = format ["<Playerkill>: %1 was killed by %2 with a %3 from %4 meters",_victimName,_killerName,_weapon,(ceil distance)]; // <--- Edit HERE Your MSG
		customkillMessage = [_kill_txt,_msg];
		publicVariable "customkillMessage";
	};
}; 

kill_msg.sqf

fnc_kill_message = {
	private ["_finaltxt","_systemmsg"];
	_finaltxt = _this select 0;
	_systemmsg = _this select 1;
	systemChat _systemmsg;
	[_finaltxt,[safezoneX + 0.01 * safezoneW,2.0],[safezoneY + 0.01 * safezoneH,0.3],30,0.5] spawn BIS_fnc_dynamicText;
};
"customkillMessage" addPublicVariableEventHandler {(_this select 1) call fnc_kill_message;}; 

Link to comment
Share on other sites

Anyone ever find a fix for that nil weapon issue? I read through the entire thread and didn't really see anything about a working fix...

 

I just kinda made my own fix for weapons... but was seeing if there was a better way to do it...

_message = format["%1 was killed by %2 with weapon %3 from %4m",_victimName, _killerName, _weapon, _distance];
_loc_message = format["PKILL: %1 was killed by %2 with weapon %3 from %4m", _victimName, _killerName, _weapon, _distance];
//_pic = _victim getVariable["AttackedByWeaponImg", "nil"];
_picture = getText (configFile >> 'cfgWeapons' >> (currentWeapon _killer) >> 'picture'); // get weapon picture of killer
// not tested from here...
if (vehicle _killer != _killer) then {
_picture = getText (configFile >> 'cfgVehicles' >> (vehicle _killer) >> 'picture');
};
//.... to here
        if ((gettext (configFile >> 'cfgWeapons' >> (currentWeapon _killer) >> 'displayName')) != "Throw") then {
if (!isNil "_picture") then {
_kill_txt = format ["<t align='left' size='0.9'>%1 </t>",_killerName,_picture,_victimName,(ceil _distance)];
_kill_txt = _kill_txt + format ["<img size='1.0' align='left' image='%2'/>",_killerName,_picture,_victimName,(ceil _distance)];
_kill_txt = _kill_txt + format ["<t align='left' size='0.9'> %3 </t>",_killerName,_picture,_victimName,(ceil _distance)];
_kill_txt = _kill_txt + format ["<t align='left' size='0.9'>[%4m]</t>",_killerName,_picture,_victimName,(ceil _distance)];
 
customkillMessage = [_kill_txt];
publicVariable "customkillMessage";
};
};
Link to comment
Share on other sites

 

Anyone ever find a fix for that nil weapon issue? I read through the entire thread and didn't really see anything about a working fix...

 

I just kinda made my own fix for weapons... but was seeing if there was a better way to do it...

_message = format["%1 was killed by %2 with weapon %3 from %4m",_victimName, _killerName, _weapon, _distance];
_loc_message = format["PKILL: %1 was killed by %2 with weapon %3 from %4m", _victimName, _killerName, _weapon, _distance];
//_pic = _victim getVariable["AttackedByWeaponImg", "nil"];
_picture = getText (configFile >> 'cfgWeapons' >> (currentWeapon _killer) >> 'picture'); // get weapon picture of killer
// not tested from here...
if (vehicle _killer != _killer) then {
_picture = getText (configFile >> 'cfgVehicles' >> (vehicle _killer) >> 'picture');
};
//.... to here
        if ((gettext (configFile >> 'cfgWeapons' >> (currentWeapon _killer) >> 'displayName')) != "Throw") then {
if (!isNil "_picture") then {
_kill_txt = format ["<t align='left' size='0.9'>%1 </t>",_killerName,_picture,_victimName,(ceil _distance)];
_kill_txt = _kill_txt + format ["<img size='1.0' align='left' image='%2'/>",_killerName,_picture,_victimName,(ceil _distance)];
_kill_txt = _kill_txt + format ["<t align='left' size='0.9'> %3 </t>",_killerName,_picture,_victimName,(ceil _distance)];
_kill_txt = _kill_txt + format ["<t align='left' size='0.9'>[%4m]</t>",_killerName,_picture,_victimName,(ceil _distance)];
 
customkillMessage = [_kill_txt];
publicVariable "customkillMessage";
};
};

 

Make sure to use the updated version on my Github!

Link to comment
Share on other sites

@overheat, using the updated killboard on your github gives me this error in the client rpt

Error in expression <DZE_plr_DeathBResult) > 0) then {

call EpochDeathBoardLoad;
} else {
cutText [(>
  Error position: <EpochDeathBoardLoad;
} else {
cutText [(>
  Error Undefined variable in expression: epochdeathboardload
File z\addons\dayz_code\actions\list_playerDeaths.sqf, line 10
Error in expression <DZE_plr_DeathBResult) > 0) then {

call EpochDeathBoardLoad;
} else {
cutText [(>
  Error position: <EpochDeathBoardLoad;
} else {
cutText [(>
  Error Undefined variable in expression: epochdeathboardload
Link to comment
Share on other sites

Follow original instructions but use the server_playerdied.sqf that is posted here

 

The only difference is he added a sleep to make the script work more often. I doubt you need a full 3 seconds though. A half second works on my overwatch server. My overpoch is still too new yet to have much pvp but I'll let you know.

works like a charm! thanks bro

Link to comment
Share on other sites

 

Anyone ever find a fix for that nil weapon issue? I read through the entire thread and didn't really see anything about a working fix...

 

I just kinda made my own fix for weapons... but was seeing if there was a better way to do it...

_message = format["%1 was killed by %2 with weapon %3 from %4m",_victimName, _killerName, _weapon, _distance];
_loc_message = format["PKILL: %1 was killed by %2 with weapon %3 from %4m", _victimName, _killerName, _weapon, _distance];
//_pic = _victim getVariable["AttackedByWeaponImg", "nil"];
_picture = getText (configFile >> 'cfgWeapons' >> (currentWeapon _killer) >> 'picture'); // get weapon picture of killer
// not tested from here...
if (vehicle _killer != _killer) then {
_picture = getText (configFile >> 'cfgVehicles' >> (vehicle _killer) >> 'picture');
};
//.... to here
        if ((gettext (configFile >> 'cfgWeapons' >> (currentWeapon _killer) >> 'displayName')) != "Throw") then {
if (!isNil "_picture") then {
_kill_txt = format ["<t align='left' size='0.9'>%1 </t>",_killerName,_picture,_victimName,(ceil _distance)];
_kill_txt = _kill_txt + format ["<img size='1.0' align='left' image='%2'/>",_killerName,_picture,_victimName,(ceil _distance)];
_kill_txt = _kill_txt + format ["<t align='left' size='0.9'> %3 </t>",_killerName,_picture,_victimName,(ceil _distance)];
_kill_txt = _kill_txt + format ["<t align='left' size='0.9'>[%4m]</t>",_killerName,_picture,_victimName,(ceil _distance)];
 
customkillMessage = [_kill_txt];
publicVariable "customkillMessage";
};
};

what nil weapon issue? I have no issue with these kill messages at all.

Link to comment
Share on other sites

 

@overheat, using the updated killboard on your github gives me this error in the client rpt

Error in expression <DZE_plr_DeathBResult) > 0) then {

call EpochDeathBoardLoad;
} else {
cutText [(>
  Error position: <EpochDeathBoardLoad;
} else {
cutText [(>
  Error Undefined variable in expression: epochdeathboardload
File z\addons\dayz_code\actions\list_playerDeaths.sqf, line 10
Error in expression <DZE_plr_DeathBResult) > 0) then {

call EpochDeathBoardLoad;
} else {
cutText [(>
  Error position: <EpochDeathBoardLoad;
} else {
cutText [(>
  Error Undefined variable in expression: epochdeathboardload

 

Did you added this line to your custom compiles?

call compile preprocessFileLineNumbers ""+YOURPATH+"\player_murderMenu.sqf";

Because it says that 'EpochDeathBoardLoad' is not defined.

Link to comment
Share on other sites

yeah

 

call compile preprocessFileLineNumbers "custom\player_murderMenu.sqf";

 

i simply dragged and dropped the file in your download, so i havnt edited it at all

 

edit

 

its obvisouly calling the file as it pulling the error, where would i define the variable  EpochDeathBoardLoad

Link to comment
Share on other sites

Here is the updated server_playerDied.sqf to be compatible with the updated murdermenu. I'll post them both.

 

server_playerDied.sqf

private ["_characterID","_minutes","_newObject","_playerID","_infected","_victim","_victimName","_killer","_killerName","_weapon","_distance","_message","_loc_message","_key","_death_record"];
//[unit, weapon, muzzle, mode, ammo, magazine, projectile]
_characterID =     _this select 0;
_minutes =        _this select 1;
_newObject =     _this select 2;
_playerID =     _this select 3;
_infected =        _this select 4;
if (((count _this) >= 6) && {(typeName (_this select 5)) == "STRING"} && {(_this select 5) != ""}) then {
    _victimName =    _this select 5;
} else {
    _victimName =  if (alive _newObject) then {name _newObject;} else {"";};
};
_victim = _newObject;
_newObject setVariable ["bodyName", _victimName, true];

sleep 3;

_killer = _victim getVariable["AttackedBy", "nil"];
_killerName = _victim getVariable["AttackedByName", "nil"];

// when a zombie kills a player _killer, _killerName && _weapon will be "nil"
// we can use this to determine a zombie kill && send a customized message for that. right now no killmsg means it was a zombie.
if ((typeName _killer) != "STRING") then
{
    _weapon = _victim getVariable["AttackedByWeapon", "nil"];
    _distance = _victim getVariable["AttackedFromDistance", "nil"];

    if ((owner _victim) == (owner _killer)) then
    {
        _message = format["%1 killed himself",_victimName];
        _loc_message = format["PKILL: %1 killed himself", _victimName];
    }
    else
    {
        _message = format["%1 was killed by %2 with weapon %3 from %4m",_victimName, _killerName, _weapon, _distance];
        _loc_message = format["PKILL: %1 was killed by %2 with weapon %3 from %4m", _victimName, _killerName, _weapon, _distance];
    
    
        _pic = _victim getVariable["AttackedByWeaponImg", "nil"];
        
                if ((gettext (configFile >> 'cfgWeapons' >> (currentWeapon _killer) >> 'displayName')) != "Throw") then {
            if (!isNil "_pic") then {
                _kill_txt = format ["<t align='left' size='0.7'>%1 </t>",_killerName,_pic,_victimName,(ceil _distance)];
                _kill_txt = _kill_txt + format ["<img size='0.9' align='left' image='%2'/>",_killerName,_pic,_victimName,(ceil _distance)];
                _kill_txt = _kill_txt + format ["<t align='left' size='0.7'> %3 </t>",_killerName,_pic,_victimName,(ceil _distance)];
                _kill_txt = _kill_txt + format ["<t align='left' size='0.7'>[%4m]</t>",_killerName,_pic,_victimName,(ceil _distance)];

                customkillMessage = [_kill_txt];
                publicVariable "customkillMessage";
            };
        };
    
    
    };

    diag_log _loc_message;

    if(DZE_DeathMsgGlobal) then {
        [nil, nil, rspawn, [_killer, _message], { (_this select 0) globalChat (_this select 1) }] call RE;
    };
    /* needs customRemoteMessage
    if(DZE_DeathMsgGlobal) then {
        customRemoteMessage = ['globalChat', _message, _killer];
        publicVariable "customRemoteMessage";
    };
    */
    if(DZE_DeathMsgSide) then {
        [nil, nil, rspawn, [_killer, _message], { (_this select 0) sideChat (_this select 1) }] call RE;
    };
    if(DZE_DeathMsgTitleText) then {
        [nil,nil,"per",rTITLETEXT,_message,"PLAIN DOWN"] call RE;
    };

    // build array to store death messages to allow viewing at message board in trader citys.
    _death_record = [
    _victimName,
    _killerName,
    _weapon,
    _pic,
    _distance,
    ServerCurrentTime
];
PlayerDeaths set [count PlayerDeaths,_death_record];
PV_DeathBoard = PlayerDeaths;
publicVariable "PV_DeathBoard";

    // Cleanup
    _victim setVariable["AttackedBy", "nil", true];
    _victim setVariable["AttackedByName", "nil", true];
    _victim setVariable["AttackedByWeapon", "nil", true];
    _victim setVariable["AttackedFromDistance", "nil", true];
};

// Might not be the best way...
/*
if (isnil "dayz_disco") then {
    dayz_disco = [];
};
*/

// dayz_disco = dayz_disco - [_playerID];
_newObject setVariable["processedDeath",diag_tickTime];

if (typeName _minutes == "STRING") then
{
    _minutes = parseNumber _minutes;
};

diag_log ("PDEATH: Player Died " + _playerID);

if (_characterID != "0") then
{
    _key = format["CHILD:202:%1:%2:%3:",_characterID,_minutes,_infected];
    #ifdef DZE_SERVER_DEBUG_HIVE
    diag_log ("HIVE: WRITE: "+ str(_key));
    #endif
    _key call server_hiveWrite;
}
else
{
    deleteVehicle _newObject;
}; 

 

player_murderMenu.sqf

EpochDeathBoardLoad = {
    createdialog "EpochDeathBoardDialog";
    {
        private ["_index"];
        _index = lbAdd [21000,_x select 0];
    } count PV_DeathBoard;
};

EpochDeathBoardClick = {
    disableSerialization;
    private ["_index","_record","_output","_record_stxt","_name","_image","_h","_m","_format","_victim","_attacker","_time","_distance"];
        _quotes = [
            "Death is God's way of telling you not to be such a wise guy.",
            "What happens if you get scared half to death, twice?",
            "Don't upset me.. I'm running out of places to hide the bodies.",
            "Don't run, you'll just die tired.",
            "Give me immortality || give me death.",
            "I can't live with death; he's always leaving the toilet seat up.",
            "Why won't you die?!?!",
            "Guns don't kill people; death kills people. It's a proven medical fact."
        ];
    _index = _this select 0;
    if (_index < 0) exitWith {};
    _output = _this select 1;
    _record = PV_DeathBoard select _index;

    _victim = _record select 0;
    _attacker = _record select 1;
    _name = _record select 2;
    _image = _record select 3;
    _distance = _record select 4;
    _time = _record select 5;

    if (isNil "_victim" || isNil "_attacker" || isNil "_name" || isNil "_distance" || isNil "_time") exitWith {_output ctrlSetStructuredText parseText "<br/><br/><br/><br/><t size='1.6' align='center'>There are some information missing for this entry</t>";};

    _format = {
        private ["_codeCount","_str"];
        _str = format["%1", _this];
        _codeCount = (count (toArray _str));
        if (_codeCount == 1) then {_str = format["0%1", _str];    };
        _str;
    };
    _h = (_time select 0) + timezoneswitch;
    _m = _time select 1;

    _record_stxt = format["<t size='1.6' align='left'>%1</t><br/><br/>",_victim];
    _record_stxt = _record_stxt + format["<t size='1' align='left'>Died at %1:%2</t><br/><br/>",(_h call _format),(_m call _format)];
    _record_stxt = _record_stxt + format["<t size='1' align='left'>Was killed by %1</t><br/><br/>",_attacker];
    _record_stxt = _record_stxt + format["<t size='1' align='left'>With a %1<br/><img size='3' image='%2' /></t><br/><br/>",_name,_image];
    _record_stxt = _record_stxt + format["<t size='1' align='left'>At a distance of %1m</t><br/><br/>",_distance];
    _record_stxt = _record_stxt + format["<t font='Bitstream'>%1</t>",(_quotes call BIS_fnc_selectRandom)];

    _output ctrlSetStructuredText parseText _record_stxt;
};

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
×
×
  • Create New...