Jump to content
  • 0

Zed's headshot only kill


Fuchs

Question

Hey Guys and Girls !

 

Anyone here know's how to setup zombies with a headshot only kill ?

 

Please if anyone has a clue about post or pm me ! :rolleyes:

 

 

cheers fuchs

 

 

 

open your compiles and search for local_zombieDamage

 

e.g.

	//local_zombieDamage = 			compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandlerZ.sqf";		//Generated by the client who created a zombie to track damage
	local_zombieDamage = 			compile preprocessFileLineNumbers "AlpenFestung\walkingdead\fn_damageHandlerZ.sqf";		//Generated by the client who created a zombie to track damage 

fn_damageHandlerZ.sqf found in dayz_code

//[unit, selectionName, damage, source, projectile]
//will only run when local to the created object
//record any key hits to the required selection
private["_zed","_selection","_damage","_hitter","_projectile","_headShots","_damageOrg"];

_zed = 			_this select 0;
_selection = 	_this select 1;
_damage = 		_this select 2;
_hitter = 		_this select 3;
_projectile = 	_this select 4;

if (local _zed) then {

	if (_damage > 1 && _projectile != "") then {
		//Record deliberate critical damages
		switch (_selection) do {
			case "head_hit": {
				if (!(_zed getVariable["hitRegistered",false])) then {
					_headShots = _hitter getVariable["headShots",0];
					_hitter setVariable["headShots",(_headShots + 1),true];
					_zed setVariable["hitRegistered",true];
				};
			};
		};
		if (_projectile isKindOf "Bolt") then {
			_damageOrg = _hitter getVariable["firedDamage",0]; //_unit getVariable["firedSelection",_selection];
			if (_damageOrg < _damage) then {
				_hitter setVariable["firedHit",[_zed,_selection],true];
				_hitter setVariable["firedDamage",_damage,true];
			};
		};
	};
};

if (_selection == "head_hit") then {
	_damage
} else {
	0
};

I wanna take it on a higher level:

 

So if you shoot on their body nothing happens ,shooting in the head their dead!

 

Anyone knows a really good scripting tutorial?

Edited by Fuchs
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Hey Guys and Girls !

 

Anyone here know's how to setup zombies with a headshot only kill ?

 

Please if anyone has a clue about post or pm me ! :rolleyes:

 

 

cheers fuchs

 

Overwrite local_zombieDamage with this:

//[unit, selectionName, damage, source, projectile]
//will only run when local to the created object
//record any key hits to the required selection
private["_zed","_selection","_damage","_hitter","_projectile","_headShots","_damageOrg"];

_zed = 			_this select 0;
_selection = 	_this select 1;
_damage = 		_this select 2;
_hitter = 		_this select 3;
_projectile = 	_this select 4;

if (local _zed) then {

	if (_damage > 1 && _projectile != "") then {
		//Record deliberate critical damages
		switch (_selection) do {
			case "head_hit": {
				if (!(_zed getVariable["hitRegistered",false])) then {
					_headShots = _hitter getVariable["headShots",0];
					_hitter setVariable["headShots",(_headShots + 1),true];
					_zed setVariable["hitRegistered",true];
				};
			};
		};
		if (_projectile isKindOf "Bolt") then {
			_damageOrg = _hitter getVariable["firedDamage",0]; //_unit getVariable["firedSelection",_selection];
			if (_damageOrg < _damage) then {
				_hitter setVariable["firedHit",[_zed,_selection],true];
				_hitter setVariable["firedDamage",_damage,true];
			};
		};
	};
};

if (_selection == "head_hit") then {
	_damage
} else {
	0
};

I've not tested this but logically it should work.

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