Kill Messages

Jump to: navigation, search

Contents

 [hide

1.7.7.1

CODE CHANGES

dayz_mission/init.sqf

Open dayz_mission/init.sqf

find

enableRadio false;

change that to

//enableRadio false;

find

#include "\z\addons\dayz_code\system\REsec.sqf"

change that to

//#include "\z\addons\dayz_code\system\REsec.sqf"

dayz_server/compile/fnc_plyrHit.sqf

Download http://dayz.st/w/community_files/Fnc_plyrHit.zip and place this new file in the dayz_server/compile folder

dayz_server/init/server_functions.sqf

Open dayz_server/init/server_functions.sqf

find

 server_updateNearbyObjects =	compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_updateNearbyObjects.sqf";

Add below that line the following new line:

 fnc_plyrHit   = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\fnc_plyrHit.sqf";

dayz_server/compile/server_playerDied.sqf

Open dayz_server/compile/server_playerDied.sqf

find

private ["_characterID","_minutes","_newObject","_playerID","_key"];
//[unit, weapon, muzzle, mode, ammo, magazine, projectile]
_characterID = 	_this select 0;
_minutes =	_this select 1;
_newObject = 	_this select 2;
_playerID = 	_this select 3;
_playerName = 	name _newObject;

//dayz_disco = dayz_disco - [_playerID];

replace with

private["_characterID","_minutes","_newObject","_playerID","_key","_playerName","_playerID","_myGroup","_group","_victim", "_killer", "_weapon", "_message", "_distance","_loc_message","_victimName","_killerName","_killerPlayerID"];
//[unit, weapon, muzzle, mode, ammo, magazine, projectile]
_characterID = 	_this select 0;
_minutes =		_this select 1;
_newObject = 	_this select 2;
_playerID = 	_this select 3;
_playerName = 	name _newObject;

_victim removeAllEventHandlers "MPHit";

_victim = _this select 2;
_victimName = _playerName;

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

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

	if (_victimName == _killerName) then 
	{
		_message = format["%1 killed himself",_victimName];
		_loc_message = format["PKILL: %1 killed himself", _victimName];
	}
	else 
	{
		_killerPlayerID = getPlayerUID _killer;
		_message = format["%1 was killed by %2 with weapon %3 from %4m",_victimName, _killerName, _weapon, _distance];
		_loc_message = format["PKILL: %1 (%5) was killed by %2 (%6) with weapon %3 from %4m", _victimName, _killerName, _weapon, _distance, _playerID, _killerPlayerID];
	};

	diag_log _loc_message;
	[nil, nil, rTITLETEXT, _message, "PLAIN DOWN", 0] call RE;

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

//dayz_disco = dayz_disco - [_playerID];

dayz_server/compile/server_playerSetup.sqf

Open dayz_server/compile/server_playerSetup.sqf

find

if (isNull _playerObj) exitWith {
	diag_log ("SETUP INIT FAILED: Exiting, player object null: " + str(_playerObj));
};

if (_playerID == "") then {
	_playerID = getPlayerUID _playerObj;
};

replace with

if (isNull _playerObj) exitWith {
	diag_log ("SETUP INIT FAILED: Exiting, player object null: " + str(_playerObj));
};

//Add MPHit event handler
diag_log("Adding MPHit EH for " + str(_playerObj));
_playerObj addMPEventHandler ["MPHit", {_this spawn fnc_plyrHit;}];

if (_playerID == "") then {
	_playerID = getPlayerUID _playerObj;
};

CUSTOM

Open dayz_server/compile/server_playerDied.sqf and edit the line

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


Example if you want to only show that a player was killed with a weapon instread of WHO killed them.

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

BattlEye edits

Open BattlEye/mpeventhandler.txt

find following lines:

5 "spawn" !="spawn BIS_Effects_AirDestruction" !="spawn BIS_Effects_AirDestructionStage2" !="spawn BIS_Effects_Burn"
5 "this" !="this enableSimulation false;this allowDammage false;this disableAI 'FSM';this disableAI 'ANIM';this disableAI 'MOVE';" !="_v setVehicleInit format [\"[this, %1, %2,false,true]spawn BIS_Effects_Burn\",_int, _t];" !="_v setVehicleInit \"[this] spawn BIS_Effects_AirDestruction\";" !="if((local(_this select 0))or(isServer))then{_this call fnc_plyrHit_local;};" !="if(local(_this select 0))then{_this call fnc_plyrDead_local;};"

replace with

1 "spawn" !="spawn BIS_Effects_AirDestruction" !="spawn BIS_Effects_AirDestructionStage2" !="spawn BIS_Effects_Burn" !="spawn fnc_plyrHit" !"fnc_plyrHit.sqf" !"server_playerSetup.sqf" !"server_playerDied.sqf"
1 "this" !="this enableSimulation false;this allowDammage false;this disableAI 'FSM';this disableAI 'ANIM';this disableAI 'MOVE';" !="this spawn fnc_plyrHit" !="_v setVehicleInit format [\"[this, %1, %2,false,true]spawn BIS_Effects_Burn\",_int, _t];" !="_v setVehicleInit \"[this] spawn BIS_Effects_AirDestruction\";" !="if((local(_this select 0))or(isServer))then{_this call fnc_plyrHit_local;};" !="if(local(_this select 0))then{_this call fnc_plyrDead_local;};"

Open BattlEye/remoteexec.txt

find following line:

5 fnc_

replace with

1 fnc_
Namespaces

Variants
Actions