Новости

SMF - Just Installed!

[Инструкция] Различное начисление humanity для фракций

ReloadeD · 1864

ReloadeD

  • Administrator
  • Новенький
  • *****
    • Сообщений: 17
    • Рейтинг: 15
    • Просмотр профиля
compiles.sqf:
	local_eventKill = 			compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_eventKill.sqf"; //найти
local_eventKill = compile preprocessFileLineNumbers "custom\local_eventKill.sqf"; //заменить

local_eventKill.sqf
//[unit, selectionName, damage, source, projectile]
//will only run when local to the created object
//record any key hits to the required selection
private ["_zed","_killer","_kills","_array","_type","_humanity"];

_array = _this select 0;
_zed = _array select 0;
_killer = _array select 1;
_type = _this select 1;

if (local _zed) then {
if ((_killer getVariable["humanity",0]) <= -2500) then {
_kills = _killer getVariable[_type,0];
_killer setVariable[_type,(_kills + 1),true];
//decrease bandit humanity when zed killed
_humanity = _killer getVariable["humanity",0];
_humanity = _humanity - 5;
_killer setVariable["humanity",_humanity,true];
}
else
{
//increase heroe humanity when zed killed
_kills = _killer getVariable[_type,0];
_killer setVariable[_type,(_kills + 1),true];
_humanity = _killer getVariable["humanity",0];
_humanity = _humanity + 5;
_killer setVariable["humanity",_humanity,true];
};
};



ReloadeD

  • Administrator
  • Новенький
  • *****
    • Сообщений: 17
    • Рейтинг: 15
    • Просмотр профиля
dayz_server.pbo\DZAI\compile\fn_countkills.sqf
private ["_killer","_victim","_killType","_killCount"];
_killer = _this select 0;
_victim = _this select 1;
_killType = _this select 2;

_killCount = _killer getVariable [_killType,0];
_killer setVariable [_killType,(_killCount +1),true];

if (DZAI_humanityGain != 0) then {
if ((_killer getVariable["humanity",0]) <= -2500) then {
_humanity = _killer getVariable["humanity",0];
_humanity = _humanity - DZAI_humanityGain;
_killer setVariable["humanity",_humanity,true];
}
else
{
_humanity = _killer getVariable["humanity",0];
_humanity = _humanity + DZAI_humanityGain;
_killer setVariable["humanity",_humanity,true];
};
};
« Последнее редактирование: Февраля 08, 2016, 03:48:03 pm от ReloadeD »