Jump to content

[Release] Custom Kill Messages


0verHeaT

Recommended Posts

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

 

I followed the instructions on the first post, the kill messages show up but it will be like killer - victim [distance] and a popup will come up saying nil picture not found. I had skimmed through the entire thread but didn't really see any posts that people were saying worked.

Link to comment
Share on other sites

I followed the instructions on the first post, the kill messages show up but it will be like killer - victim [distance] and a popup will come up saying nil picture not found. I had skimmed through the entire thread but didn't really see any posts that people were saying worked.

You didnt look hard enough man. Literally one page back I posted

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;}; 

Hey man these didnt work for me. Did I miss something?

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)];

				_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];
				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;
};

 

kill_msg.sqf

/*** Written by 0verHeaT ***/
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

Hey man these didnt work for me. Did I miss something?

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)];

				_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];
				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;
};

 

kill_msg.sqf

/*** Written by 0verHeaT ***/
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;}; 

customkillMessage = [_kill_txt,_msg];
Link to comment
Share on other sites

customkillMessage = [_kill_txt,_msg];

thanks I missed that. The system chat message shows up but it says  A was killed by B with C from Scalar meters

 

The kill feed and the deathboard both display the correct distance, just the system chat message does not.

 

should this

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

be this?

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

Yes that is the problem and I have resolved it.

Link to comment
Share on other sites

someone know what is going on there?

21:15:07 "PKILL: Andrey killed himself"
21:15:07 Error in expression < = [
_victimName,
_killerName,
_weapon,
_pic,
_distance,
ServerCurrentTime
];
Pl>
21:15:07   Error position: <_pic,
_distance,
ServerCurrentTime
];
Pl>
21:15:07   Error Undefined variable in expression: _pic
21:15:07 File z\addons\dayz_server\compile\server_playerDied.sqf, line 77

Server_playerdied.sqf

http://pastebin.com/wynvHmK9

 

fnc_plyrHit.sqf

http://pastebin.com/Af7krzh6

 

kill_msg.sqf

http://pastebin.com/1QiN0ti5

 

and a question, i did killboard fix, and you said we can see this in trader city??

where in trader city, i have never saw this.

Link to comment
Share on other sites

someone know what is going on there?

21:15:07 "PKILL: Andrey killed himself"
21:15:07 Error in expression < = [
_victimName,
_killerName,
_weapon,
_pic,
_distance,
ServerCurrentTime
];
Pl>
21:15:07   Error position: <_pic,
_distance,
ServerCurrentTime
];
Pl>
21:15:07   Error Undefined variable in expression: _pic
21:15:07 File z\addons\dayz_server\compile\server_playerDied.sqf, line 77

Server_playerdied.sqf

http://pastebin.com/wynvHmK9

 

fnc_plyrHit.sqf

http://pastebin.com/Af7krzh6

 

kill_msg.sqf

http://pastebin.com/1QiN0ti5

 

and a question, i did killboard fix, and you said we can see this in trader city??

where in trader city, i have never saw this.

 

This apears (in your case) if someone killed himself.

You could move this line in your server_playerDied.sqf

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

right under 

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

to fix this.

 

Alternatively, you can use the updated version on my github.

The fix is already included there.

Link to comment
Share on other sites

 

what are the differences in the new version, in addition to sleep 3;
and this fix?
 
and where the hell i can see this killboard on chernarus?
someone give me a screenshot, i cant find it in google.

 

If you go back one page, there is a guy asking for the updated files, which I linked to him my post from the page before that with all of the correct files you need to use. Copy and paste.

The deathboards are in the safe zones, I think default safe zones only have one in Stary. It looks like a white sign on 2 wooden legs standing up about face level near the vehicle trader/weapon tent traders. Classname is "Info_Board_EP1"

Link to comment
Share on other sites

If anyone wants a system chat message to pop up in addition to the kill feed with pictures, use these 2 files.
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)];

				_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";
			};
		}; 
	
	
	};

	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;
};

 

kill_msg.sqf

/*** Written by 0verHeaT ***/
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;}; 

 

It will look like this
NdywL8K.jpg

Link to comment
Share on other sites

just for you know 0verHeaT your player_murderMenu.sqf in https://github.com/0verHeaT/CustomKillMsg/tree/master/mission

 

is giving this error >>

 

Error in expression <>With a %1<br/>,_name];
if (_image != "nil") then {
_record_stxt = _record_s>
  Error position: <nil") then {
_record_stxt = _record_s>
  Error Missing ]
File mpmissions\__CUR_MP.Chernarus\custom\player_murderMenu.sqf, line 50

---------

 

i'm using DangerRuss files now.

Link to comment
Share on other sites

 

just for you know 0verHeaT your player_murderMenu.sqf in https://github.com/0verHeaT/CustomKillMsg/tree/master/mission

 

is giving this error >>

 

Error in expression <>With a %1<br/>,_name];
if (_image != "nil") then {
_record_stxt = _record_s>
  Error position: <nil") then {
_record_stxt = _record_s>
  Error Missing ]
File mpmissions\__CUR_MP.Chernarus\custom\player_murderMenu.sqf, line 50

---------

 

i'm using DangerRuss files now.

 

 

I noticed a small syntax error. Has been updated.

Link to comment
Share on other sites

  • 2 weeks later...

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...