Add customizable zombie humanity for server admins

This commit is contained in:
A Man
2021-08-26 11:50:47 +02:00
parent d5656fb48b
commit 1a8d45e15b

View File

@@ -1,19 +1,18 @@
//[unit, selectionName, damage, source, projectile]
//[unit, killer]
//will only run when local to the created object
//record any key hits to the required selection
private["_killer"];
_array = _this select 0;
_zed = _array select 0;
_killer = _array select 1;
_type = _this select 1;
local _array = _this select 0;
local _zed = _array select 0;
local _killer = _array select 1;
local _type = _this select 1;
if (local _zed) then {
_kills = _killer getVariable[_type,0];
if (local _zed && isPlayer _killer) then {
local _kills = _killer getVariable[_type,0];
_killer setVariable[_type,(_kills + 1),true];
//increase players humanity when zed killed
_humanity = _killer getVariable["humanity",0];
_humanity = _humanity + 5;
local _humanity = _killer getVariable["humanity",0];
_humanity = _humanity + DZE_ZombieHumanity;
_killer setVariable["humanity",_humanity,true];
};