Просмотр сообщений

В этом разделе можно просмотреть все сообщения, сделанные этим пользователем.


Темы - ReloadeD

Страницы: [1] 2
1
extra_rc.hpp
    class M4A3_EP1 {
class m4a3_add_attach {
text = "Add: Attahcments";
script = "[['SOURCE_WPN','OUTPUT_WPN','TEXT',0],[0,0],['TOOL1','TOOL2'],['ADD_ITEM1','ADD_ITEM2'],['REM_ITEM1','REM_ITEM1'],['ADD_TOOL1','ADD_TOOL2'],['REM_TOOL1','REM_TOOL2']] execVM 'custom\craft.sqf';";
};
    };

craft.sqf
private["_source","_output","_text","_type","_workbench","_fireplace","_tools","_addMag","_remMag","_addWpn","_remWpn","_dist","_pos","_rad","_nearwork","_nearfire","_holder","_txt1","_txt2","_selected","_mgs","_num","_cnt","_result"];

_source = (_this select 0) select 0; // Исходный предмет (weapon или magazine)
_output = (_this select 0) select 1; // Изготавливаемый предмет (weapon или magazine)
_text = (_this select 0) select 2; // Текст после успешного выполнения
_type = (_this select 0) select 3; // Тип изготавливаемого (weapon=0, magazine=1)
_workbench = (_this select 1) select 0; // Требование верстака (no=0, yes=1)
_fireplace = (_this select 1) select 1; // Требование костра (no=0, yes=1)
_tools = (_this select 2); // Необходимые инструменты [массив, количество не ограничено]
_addMag = (_this select 3); // Добавляемые предметы (magazines) [массив, количество не ограничено]
_remMag = (_this select 4); // Удаляемые предметы (magazines) [массив, количество не ограничено]
_addWpn = (_this select 5); // Добавляемые предметы (weapons) [массив, количество не ограничено]
_remWpn = (_this select 6); // Удаляемые предметы (weapons) [массив, количество не ограничено]
_dist = 3; // Дистанция до костра/верстака
_pos = getPosATL player;
_rad = 1;
_nearwork = count (nearestObjects [player, ["Wooden_shed_DZ","WoodShack_DZ","WorkBench_DZ"], _dist]);
_nearfire = {inflamed _x} count (getPosATL player nearObjects _dist);
_num = "";
_result = false;

if ((_fireplace > 0) and (_nearfire == 0)) exitwith {
[format["Требуется костер в радиусе %1 метров",_dist],1] call dayz_rollingMessages;
};
if ((_workbench > 0) and (_nearwork == 0)) exitwith {
[format["Требуется верстак в радиусе %1 метров",_dist],1] call dayz_rollingMessages;
};

{
if (_x !="" && !(player hasWeapon _x)) exitwith {
_txt1 = (gettext (configFile >> 'cfgweapons' >> _x >> 'displayName'));
[format["Нужен инструмент %1",_txt1],1] call dayz_rollingMessages;
_result = true;
};
} count _tools;

{
if (_x !="") then {
_selected = _x;
_mgs = {_selected == _x} count magazines player;
_cnt = {_selected == _x} count _remMag;
if (_selected == _source) then {
_cnt = _cnt + 1;
};
if !(_selected in magazines player) then {
_num = _cnt;
_txt2 = (gettext (configFile >> 'cfgmagazines' >> _x >> 'displayName'));
[format["Необходимо еще %1шт %2",_num,_txt2],1] call dayz_rollingMessages;
_result = true;
} else {
if  (_mgs < _cnt) then {
_num = _cnt - _mgs;
} else {
_num = 0;
};
if  (_num != 0) exitwith {
_txt2 = (gettext (configFile >> 'cfgmagazines' >> _x >> 'displayName'));
[format["Необходимо еще %1шт %2",_num,_txt2],1] call dayz_rollingMessages;
_result = true;
};
};
};
} count _remMag;

{
if (_x !="" && !(player hasWeapon _x)) exitwith {
_txt1 = (gettext (configFile >> 'cfgweapons' >> _x >> 'displayName'));
[format["Нужен %1",_txt1],1] call dayz_rollingMessages;
_result = true;
};
} count _remWpn;

if (_result) exitWith {};

closeDialog 0;

dayz_actionInProgress = true;
player playActionNow "Medic";
[player,"repair",0,false,10] call dayz_zombieSpeak;
[player,10,true,(getPosATL player)] spawn player_alertZombies;
sleep 6;
_holder = createVehicle ["WeaponHolder", _pos, [], _rad, "CAN_COLLIDE"];
_holder setposATL _pos;

{_holder addMagazineCargoGlobal [_x,1];} count _addMag;
{player removeMagazine _x;} count _remMag;
{_holder addWeaponCargoGlobal [_x,1];} count _addWpn;
{player removeWeapon _x;} count _remWpn;

if (_type > 0) then {
player removeMagazine _source;
_holder addMagazineCargoGlobal [_output,1];
} else {
player removeWeapon _source;
_holder addWeaponCargoGlobal [_output,1];
};

sleep 2;
player reveal _holder;
player action ["Gear", _holder];
sleep 1;
[format["%1",_text],1] call dayz_rollingMessages;
dayz_actionInProgress = false;

Установка extra_rc.hpp

2
dayz_spaceInterrupt.sqf
// вставить в самом низу над _handled
if (_dikCode == 0x53) then {
_nil = ["Decimal"] execVM "fixes\keys.sqf";
_handled = true;
};

if (_dikCode == 0x29) then {
_nil = ["Tilde"] execVM "fixes\keys.sqf";
_handled = true;
};

if (_dikCode == 0xC7) then {
_nil = ["Home"] execVM "fixes\keys.sqf";
_handled = true;
};

if (_dikCode == 0x3B) then {
_nil = ["F1"] execVM "fixes\keys.sqf";
_handled = true;
};

if (_dikCode == 0x19 && _shift) then {
_nil = ["ShiftP"] execVM "fixes\keys.sqf";
_handled = true;
};

keys.sqf
private ["_time","_presskey","_key"];
_key = _this select 0;
_time = 15;
_presskey = true;

/* Allowed List */
if ((getPlayerUID player) in ["111222333","444555666","777888999"]) exitWith {
//diag_log("PRESSKEY: Test OK!");
};

disableSerialization;
disableUserInput true;

if(_presskey) then {
switch (_key) do
{
case "Decimal":
{
player setVariable["startcombattimer",1,true];
};
case "Tilde":
{
player setVariable["startcombattimer",1,true];
};
case "Home":
{
player setVariable["startcombattimer",1,true];
};
case "F1":
{
player setVariable["startcombattimer",1,true];
};
case "ShiftP":
{
player setVariable["startcombattimer",1,true];
};
};
(findDisplay 106) closeDisplay 0;
PVDZE_atp = format["PRESSKEY: Player %1 (%2) press %3 Key. Pos: %4 %5",name player,getPlayerUID player,_key,mapGridPosition(getPosATL player),getPosATL player];
publicVariableServer "PVDZE_atp";
startLoadingScreen ["Зафикисровано нажатие запрещенных клавиш!", "DayZ_loadingScreen"];
sleep _time;
endLoadingScreen;
(findDisplay 46) closeDisplay 0;
};

https://community.bistudio.com/wiki/DIK_KeyCodes

3
mission.sqf
// для NAPF (Observatory)
if (isServer) then {

_vehicle_0 = objNull;
if (true) then
{
  _this = createVehicle ["Land_Ind_Oil_Tower_EP1", [16631.457, 18509.262, -0.0089469124], [], 0, "CAN_COLLIDE"];
  _vehicle_0 = _this;
  _this setDir -21.144699;
  _this setPos [16631.457, 18509.262, -0.0089469124];
};

_vehicle_1 = objNull;
if (true) then
{
  _this = createVehicle ["Land_Ind_Oil_Pump_EP1", [16627.26, 18523.248, -0.38578352], [], 0, "CAN_COLLIDE"];
  _vehicle_1 = _this;
  _this setDir 67.465546;
  _this setPos [16627.26, 18523.248, -0.38578352];
};

_vehicle_2 = objNull;
if (true) then
{
  _this = createVehicle ["Barrels", [16625.332, 18521.629, 0.17259257], [], 0, "CAN_COLLIDE"];
  _vehicle_2 = _this;
  _this setDir -23.203114;
  _this setPos [16625.332, 18521.629, 0.17259257];
};

_vehicle_3 = objNull;
if (true) then
{
  _this = createVehicle ["Barrels", [16630.93, 18510.822, 5.1769428], [], 0, "CAN_COLLIDE"];
  _vehicle_3 = _this;
  _this setDir -21.676802;
  _this setPos [16630.93, 18510.822, 5.1769428];
};

};

processInitCommands;

// для Origins (Taviana Oilfields)
if (isServer) then {

_vehicle_0 = objNull;
if (true) then
{
  _this = createVehicle ["Barrels", [8482.333, 16683.791, 0.00020122528], [], 0, "CAN_COLLIDE"];
  _vehicle_0 = _this;
  _this setDir 78.419907;
  _this setPos [8482.333, 16683.791, 0.00020122528];
};

_vehicle_1 = objNull;
if (true) then
{
  _this = createVehicle ["Barrels", [8494.0107, 16689.762, -0.00042533875], [], 0, "CAN_COLLIDE"];
  _vehicle_1 = _this;
  _this setPos [8494.0107, 16689.762, -0.00042533875];
};

_vehicle_2 = objNull;
if (true) then
{
  _this = createVehicle ["Barrels", [8483.1904, 16717.623, -1.9073486e-006], [], 0, "CAN_COLLIDE"];
  _vehicle_2 = _this;
  _this setPos [8483.1904, 16717.623, -1.9073486e-006];
};

_vehicle_3 = objNull;
if (true) then
{
  _this = createVehicle ["Barrels", [8597.915, 16543.994, 1.9073486e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_3 = _this;
  _this setPos [8597.915, 16543.994, 1.9073486e-005];
};

_vehicle_4 = objNull;
if (true) then
{
  _this = createVehicle ["Barrels", [8584.5352, 16531.689, 5.7220459e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_4 = _this;
  _this setPos [8584.5352, 16531.689, 5.7220459e-005];
};

_vehicle_5 = objNull;
if (true) then
{
  _this = createVehicle ["Barrels", [8586.7373, 16563.609, 9.5367432e-006], [], 0, "CAN_COLLIDE"];
  _vehicle_5 = _this;
  _this setPos [8586.7373, 16563.609, 9.5367432e-006];
};

_vehicle_6 = objNull;
if (true) then
{
  _this = createVehicle ["Barrels", [8534.0771, 16387.494, -7.0095062e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_6 = _this;
  _this setPos [8534.0771, 16387.494, -7.0095062e-005];
};

_vehicle_7 = objNull;
if (true) then
{
  _this = createVehicle ["Barrels", [8548.874, 16390.488, 0.00013113022], [], 0, "CAN_COLLIDE"];
  _vehicle_7 = _this;
  _this setPos [8548.874, 16390.488, 0.00013113022];
};

_vehicle_8 = objNull;
if (true) then
{
  _this = createVehicle ["Barrels", [8522.1768, 16420.061, -0.00015115738], [], 0, "CAN_COLLIDE"];
  _vehicle_8 = _this;
  _this setPos [8522.1768, 16420.061, -0.00015115738];
};

_vehicle_9 = objNull;
if (true) then
{
  _this = createVehicle ["Barrels", [8409.2129, 16328.884, 3.5524368e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_9 = _this;
  _this setPos [8409.2129, 16328.884, 3.5524368e-005];
};

_vehicle_10 = objNull;
if (true) then
{
  _this = createVehicle ["Barrels", [8410.1475, 16322.804, -5.0544739e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_10 = _this;
  _this setPos [8410.1475, 16322.804, -5.0544739e-005];
};

_vehicle_11 = objNull;
if (true) then
{
  _this = createVehicle ["Barrels", [8868.8203, 15483.096, 4.5776367e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_11 = _this;
  _this setPos [8868.8203, 15483.096, 4.5776367e-005];
};

_vehicle_12 = objNull;
if (true) then
{
  _this = createVehicle ["Barrels", [8864.6143, 15481.8, 4.5776367e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_12 = _this;
  _this setPos [8864.6143, 15481.8, 4.5776367e-005];
};

_vehicle_13 = objNull;
if (true) then
{
  _this = createVehicle ["Barrels", [8861.1914, 15479.081, -1.5258789e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_13 = _this;
  _this setPos [8861.1914, 15479.081, -1.5258789e-005];
};

_vehicle_14 = objNull;
if (true) then
{
  _this = createVehicle ["Barrels", [8857.0898, 15476.922, -9.5367432e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_14 = _this;
  _this setPos [8857.0898, 15476.922, -9.5367432e-005];
};

_vehicle_15 = objNull;
if (true) then
{
  _this = createVehicle ["Barrels", [8851.543, 15473.568, 0.00011825562], [], 0, "CAN_COLLIDE"];
  _vehicle_15 = _this;
  _this setPos [8851.543, 15473.568, 0.00011825562];
};

_vehicle_16 = objNull;
if (true) then
{
  _this = createVehicle ["Barrels", [8859.5107, 15472.936, 1.5258789e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_16 = _this;
  _this setPos [8859.5107, 15472.936, 1.5258789e-005];
};

_vehicle_17 = objNull;
if (true) then
{
  _this = createVehicle ["Barrels", [8865.5488, 15475.983, 3.0517578e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_17 = _this;
  _this setPos [8865.5488, 15475.983, 3.0517578e-005];
};

_vehicle_18 = objNull;
if (true) then
{
  _this = createVehicle ["Barrels", [8871.1602, 15478.94, 0], [], 0, "CAN_COLLIDE"];
  _vehicle_18 = _this;
  _this setPos [8871.1602, 15478.94, 0];
};

_vehicle_19 = objNull;
if (true) then
{
  _this = createVehicle ["Barrels", [8853.9941, 15468.681, 6.8664551e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_19 = _this;
  _this setPos [8853.9941, 15468.681, 6.8664551e-005];
};

};

processInitCommands;

fn_selfActions.sqf
private["_isBarrels"]; // добавить
// вставить ниже строки _isAlive = alive _cursorTarget;
_isBarrels = _typeOfCursorTarget in ["Barrels"];
	// Fill OilBarrels
_oilBarrelEmpty = cursorTarget getVariable ["oilBarrelEmpty",false];
if (_isBarrels && !_oilBarrelEmpty) then {
if (s_player_filloil < 0) then {
s_player_filloil = player addAction ["Наполнить бочку нефтью", "custom\fill_oilbarrel.sqf",cursorTarget, 0, false, true, "",""];
};
} else {
player removeAction s_player_filloil;
s_player_filloil = -1;
};
	player removeAction s_player_flipveh; // найти
s_player_flipveh = -1; // найти
player removeAction s_player_filloil; // добавить
s_player_filloil = -1; // добавить
variables.sqf
	s_player_flipveh = -1; // найти
s_player_filloil = -1; // добавить

fill_oilbarrel.sqf
private["_random","_barrels","_hasBarrelEmpty","_oilBarrelEmpty","_dis","_sfx","_oilbarrel","_addOil"];

_random = random 10;
_barrels = _this select 3;
_hasBarrelEmpty = {_x == "ItemFuelBarrelEmpty"} count magazines player;
_oilbarrel = "ItemOilBarrel";

if (DZE_ActionInProgress) exitWith { cutText ["Бочка уже наполняется!" , "PLAIN DOWN"]; };

if(_hasBarrelEmpty >= 1) then {
DZE_ActionInProgress = true;
player playActionNow "Medic";
_dis=50;
_sfx = "refuel";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak; 
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
sleep 6;
_oilBarrelEmpty = _barrels getVariable ["oilBarrelEmpty",false];
if(!_oilBarrelEmpty) then {
player removeMagazine "ItemFuelBarrelEmpty";
_addOil = [player,_oilbarrel] call BIS_fnc_invAdd;
        if (_addOil) then {
if (_random > 2) then {
DZE_ActionInProgress = false;
cutText ["Вы наполнили бочку нефтью.","PLAIN DOWN"];
player removeAction s_player_filloil;
s_player_filloil = -1;
} else {
DZE_ActionInProgress = false;
_barrels setVariable ["oilBarrelEmpty",true,true];
cutText ["Запас нефти исчерпан...", "PLAIN DOWN"];
player removeAction s_player_filloil;
s_player_filloil = -1;
};
} else {
cutText ["Недостаточно места в снаряжении...", "PLAIN DOWN"];
DZE_ActionInProgress = false;
player removeAction s_player_filloil;
s_player_filloil = -1;
        };
} else {
cutText ["Запас нефти исчерпан...", "PLAIN DOWN"];
DZE_ActionInProgress = false;
player removeAction s_player_filloil;
s_player_filloil = -1;
};
} else {
DZE_ActionInProgress = false;
cutText ["Требуется пустая бочка...", "PLAIN DOWN"];
};

AHconfig.sqf
_dayzActions =
[
"s_player_filloil"  //добавить
];

setvariable.txt
//добавить во вторую строку, должно выглядеть так
5 "\+" !="oilBarrelEmpty"

4
fn_selfActions.sqf
	_isTent = _cursorTarget isKindOf "TentStorage"; // найти
_isTent = _typeOfCursorTarget in ["TentStorage","TentStorageDomed","TentStorageDomed2"]; // заменить
    //Sleep - ниже заменить весь блок
if(_isTent) then {
if ((s_player_sleep < 0) && (player distance _cursorTarget < 3)) then {
s_player_sleep = player addAction ["Отдохнуть", "custom\player_sleep.sqf",_cursorTarget, 0, false, true, "",""];
};
} else {
player removeAction s_player_sleep;
s_player_sleep = -1;
};

player_sleep.sqf
//http://community.bistudio.com/wiki/ArmA2:_Moves
private ["_blood","_random"];
_random = random 10;
_blood = player getVariable['USEC_BloodQty', r_player_blood];

if (dayz_combat == 1) exitWith {titleText [format["Нельзя отдыхать во время боя!"], "PLAIN DOWN"];};

player playMove "amovpsitmstpsraswrfldnon_smoking"; // - Sitting smoking

waitUntil { animationState player != "amovpsitmstpsraswrfldnon_smoking"};

sleep 5;

player playMove "amovpsitmstpsraswrfldnon_weaponcheck1"; // - Sitting checking weapon

waitUntil { animationState player != "amovpsitmstpsraswrfldnon_weaponcheck1"};

sleep 5;

player playMove "AidlPpneMstpSnonWnonDnon_SleepC_layDown";

waitUntil { animationState player != "AidlPpneMstpSnonWnonDnon_SleepC_layDown"};

sleep 5;

player playMove "AidlPpneMstpSnonWnonDnon_SleepC_lookAround";

waitUntil { animationState player != "AidlPpneMstpSnonWnonDnon_SleepC_lookAround"};

sleep 5;

player playMove "AidlPpneMstpSnonWnonDnon_SleepC_scratch";

waitUntil { animationState player != "AidlPpneMstpSnonWnonDnon_SleepC_scratch"};

sleep 5;

player playMove "AidlPpneMstpSnonWnonDnon_SleepC_sleep";

waitUntil { animationState player != "AidlPpneMstpSnonWnonDnon_SleepC_sleep"};

sleep 5;

player playMove "AidlPpneMstpSnonWnonDnon_SleepC_sleep0";

waitUntil { animationState player != "AidlPpneMstpSnonWnonDnon_SleepC_sleep0"};

sleep 5;

player playMove "AidlPpneMstpSnonWnonDnon_SleepC_standUp";

waitUntil { animationState player != "AidlPpneMstpSnonWnonDnon_SleepC_standUp"};

if (r_player_infected) then { // если игрок инфецирован
if (_random <= 1) then { // шанс на излечение 10%
r_player_infected = false;
r_player_blood = 12000;
r_player_inpain = false;
r_player_lowblood = false;
dayz_temperatur = 42;
R3F_TIRED_Accumulator = 0;
titleText [format["Вы выздоровели!"], "PLAIN DOWN"];
} else {
r_player_inpain = false;
dayz_temperatur = 42;
R3F_TIRED_Accumulator = 0;
titleText [format["Вы сняли усталость."], "PLAIN DOWN"];
};
} else {
if (_blood < 10000) then { // если крови меньше 10000
_blood = _blood + 2000; // восстановить не более +2000
player setVariable ['USEC_BloodQty',_blood,true];
r_player_inpain = false;
dayz_temperatur = 42;
R3F_TIRED_Accumulator = 0;
titleText [format["Вы немного отдохнули."], "PLAIN DOWN"];
} else {
r_player_blood = 12000;
r_player_inpain = false;
r_player_lowblood = false;
dayz_temperatur = 42;
R3F_TIRED_Accumulator = 0;
titleText [format["Вы полностью восстановили здоровье!"], "PLAIN DOWN"];
};
};

5
description.ext
class RscTitles 
{
#include "custom\show_friends\friends_icons.hpp" //добавить
};

init.sqf
[] execVM "custom\show_friends\ficoninit.sqf"; //добавить в самом конце

\custom\show_friends\friends_icons.hpp
class NameTag
{
idd = -1;
onLoad = "uiNamespace setVariable ['ultima_friends_display', _this select 0]; _this execVM 'custom\show_friends\ficon.sqf'";
fadein = 0;
fadeout = 0;
duration = 1e+1000;
controlsBackground[] = {};
objects[] = {};
class controls
{
class NT_BASIC
{
idc = 7200;
type = 13;
style = 16 + 0x200;
x = -1;
y = -1;
w = 0.4;
h = 0.1;
sizeEx = 0.025;
size = 0.025;
font = "Zeppelin32";
linespacing = 1;
colorBackground[] = {0,0,0,0};
colorText[] = {1,1,1,0};
text = "";
};
class NT1 : NT_BASIC
{idc = 7201;};
class NT2 : NT_BASIC
{idc = 7202;};
class NT3 : NT_BASIC
{idc = 7203;};
class NT4 : NT_BASIC
{idc = 7204;};
class NT5 : NT_BASIC
{idc = 7205;};
class NT6 : NT_BASIC
{idc = 7206;};
class NT7 : NT_BASIC
{idc = 7207;};
class NT8 : NT_BASIC
{idc = 7208;};
class NT9 : NT_BASIC
{idc = 7209;};
class NT10 : NT_BASIC
{idc = 7210;};
class NT11 : NT_BASIC
{idc = 7211;};
};
};

\custom\show_friends\ficon.sqf
disableSerialization;
private ["_pm","_Man","_Visibility","_list_friends_gps","_GPSVisibility","_RadioVisibility","_player_ID","_recPlayer_ID","_player_friends","_recPlayer_friends","_list_friends","_DC","_ColorName","_ColorHealth","_ColorDistance","_ColorVehicleType","_isNot","_isIn","_AmountOfUnits","_NameOfUnit","_Who","_Distance","_Health","_Screen","_Text","_NoVeh","_YesVeh","_CND","_isShown","_Display"];

_DC = uiNamespace getVariable 'ultima_friends_display';
_ColorName = "#AAFFAA"; //
_ColorHealth = "#FFFFFF"; //
_ColorDistance = "#AAAAFF"; //
_ColorVehicleType = "#FFFFFF"; //
_Visibility = 100; // Дальность видимости имени, здоровья, дистанции - в 3D, до друга.
_RadioVisibility = 500; // Дальность видимости имени, здоровья, дистанции - в 3D, до друга, при наличии рации, у друга, и у себя.
_GPSVisibility = 2000; // Дальность видимости на карте, при налчии GPS, у друга и у себя.
_AmountOfUnits = 10; // Максимальное кол-во юнитов для отображения(ограничено кол-вом классов, объявленых в friends_icons.hpp).

_isNot = "<t align='center'><t color='%5'>%1</t><br/><t color='%6'>[%2%3]</t><br/><t color='%7'>%4 m</t></t>";
_isIn = "<t align='center'><t color='%4'>%1</t><br/><t color='%5'>[%2]</t><br/><t color='%6'>%3 m</t></t>";

// Получаем свой ID
_player_ID = player getVariable ["CharacterID", "0"];
while {alive player} do
{
while {!ultima_show_friends_var} do
{sleep 1};
if (str(_DC) == "No display") exitWith
{
sleep 5;
1 cutrsc ["NameTag","PLAIN"];
};
// Получаем список друзей.
_player_friends = player getVariable ["friendlies",[]];
// Обнуляем список друзей (LIST)
_list_friends = [];
_list_friends_gps = [];


// Проверяем друзей, - что мы тоже у них в списке друзей.(Подтверждены).
{ // Цикл по всем юнитам на карте
if ((count _list_friends) == _AmountOfUnits) ExitWith {}; // Если список достиг лимита отображения - выходим.
if (alive _x) then // Если юнит живой
{
_recPlayer_ID = _x getVariable["CharacterID","0"]; // Получаем ID юнита
if (_recPlayer_ID in _player_friends) then // Если его ID найден в наших друзьях
{
_recPlayer_friends = _x getVariable ["friendlies",[]]; // Получаем список друзей юнита
if (_player_ID in _recPlayer_friends) then // Если, мы у него так же в друзьях
{
// Проверяем расстояние до друга, для отображения: Имени, здоровья, расстояния.
if ( (_x distance player < _Visibility) ||  ( (_x distance player < _RadioVisibility) && (player hasWeapon "ItemRadio") && (_x hasWeapon "ItemRadio") ) ) then
{_list_friends set [count _list_friends, _x];}; // Добавляем друга в список для отображения.
// Проверяем расстояние до друга, и наличие GPS, для отображения на карте.
if ( ("ItemGPS" in items player) && (_x distance player < _GPSVisibility) and ("ItemGPS" in items _x) ) then
{_list_friends_gps set [count _list_friends_gps, _x];}; // Добавляем друга в список для отображения на карте.
};
};
};
} forEach playableUnits;

for "_i" from 0 to _AmountOfUnits do
{
if ( (_i < (count _list_friends)) && ( (count _list_friends) > 0 ) && (!visibleMap) && (ultima_show_friends_var) ) then // Если дисплей меньше, или равен кол-ву записей в списке отображения - выводим.
{
_Man = (_list_friends select _i);
_Who = (vehicle _Man);
_Distance = round (_Man distance player);
_Health = ceil ((_Man getVariable['USEC_BloodQty',12000]) / 120);
_ManName = name _Man;
_Screen = (worldToScreen [(getPosATL _Man select 0), (getPosATL _Man select 1), (getPosATL _Man select 2) + 4]);
_Text = getText (configFile >> "CfgVehicles" >> (typeOf _Who) >> "DisplayName");
_NoVeh = parseText format [_isNot, _ManName, _Health, "%", _Distance, _ColorName, _ColorHealth, _ColorDistance];
_YesVeh = parsetext format [_isIn, _ManName, _Text, _Distance, _ColorName, _ColorVehicleType, _ColorDistance];
_CND = if (_Who != _Man) then
{
if (_Man == effectiveCommander _Who) then
{_YesVeh}
else
{parseText ""}
}
else
{_NoVeh};
_isShown = (count _Screen);
if (!isNull player && _isShown > 0 && !visibleMap) then
{
_Display = _DC displayCtrl (7201 + _i);
_Display ctrlSetPosition [(_Screen select 0)-0.2,(_Screen select 1)];
_Display ctrlSetStructuredText _CND;
_Display ctrlCommit 0;
}
else
{
_Display = _DC displayCtrl (7201 + _i);
_Display ctrlSetStructuredText parseText "";
_Display ctrlCommit 0;
};
}
else
{
_Display = _DC displayCtrl (7201 + _i);
_Display ctrlSetStructuredText parseText "";
_Display ctrlCommit 0;
};
};
// Если есть GPS
if ("ItemGPS" in items player) then
{
if ("ItemGPS" in items player) then
{
for "_i" from 0 to (_AmountOfUnits + 1) do
{deleteMarkerLocal ("ultima_gps" + (str _i));};
};
// Добавляем себя, в список отображения на карте.
_list_friends_gps set [count _list_friends_gps, player];
for "_i" from 0 to (count _list_friends_gps) - 1 do
{
deleteMarkerLocal ("ultima_gps" + (str _i));
if ( (alive (_list_friends_gps select _i)) )  then
{
deleteMarkerLocal ("ultima_gps" + (str _i));
_pm = createMarkerLocal [("ultima_gps" + (str _i)), getPos (_list_friends_gps select _i)];
_pm setMarkerTypeLocal "selector_selectedMission";
_pm setMarkerSizeLocal [0.8, 0.8];
_pm setMarkerTextLocal format ["%1", name (_list_friends_gps select _i)];
_pm setMarkerColorLocal ("ColorBlue");
};
};
};
sleep 0.003;
/*if (!isnull (finddisplay 75)) then
{systemChat ("<Ultima>: НАЙДЕНА МИНИКАРТА");}
else
{systemChat ("<Ultima>: МИНИКАРТА ОТКЛЮЧЕНА");};
*/
};

\custom\show_friends\ficoninit.sqf
ultima_show_friends_var	=	true;
waituntil {!isnull (finddisplay 46)};
systemChat ("<Ultima>: Отключение имен друзей: Shift+1");
Ultima_Show_Friends =
{
if ( (_this select 1 == 2) && (_this select 2) ) then // shift+1
{
ultima_show_friends_var = !ultima_show_friends_var;
if (ultima_show_friends_var) then
{systemChat ("<Ultima>: Отображение имен друзей включено!");}
else
{systemChat ("<Ultima>: Отображение имен друзей отключено!");}
};
};
(findDisplay 46) displayAddEventHandler["KeyUp","_this call Ultima_Show_Friends"];
sleep 1;
1 cutrsc ["NameTag","PLAIN"];

AH.sqf
//найти
if(isNil 'playableUnits')then{playableUnits = [player];} else {
if(typeName playableUnits != 'ARRAY')then{playableUnits = [player];YOLO = true;} else {

//заменить на
if (isNil 'playableUnits') then {} else {
if (typeName playableUnits != 'ARRAY') then {YOLO = true;} else {


// найти и удалить
lbSetData='no';createMarkerLocal='no';setMarkerColorLocal='no';setMarkerSizeLocal='no';setMarkerTypeLocal='no';

// найти и удалить
'lbSetData','createMarkerLocal','setMarkerColorLocal','setMarkerSizeLocal','setMarkerTypeLocal',

AHconfig.sqf (если редактирование AH.sqf не помогло)
_BHF = false;
_CUD =  false;
_RCK =  false;
//или
_BHF =  false;
_FRC =  false;

6
variables.sqf
if(isNil "DZE_PlotPole") then {
DZE_PlotPole = [30,45]; // установить радиус
};
if(isNil "DZE_BuildingLimit") then {
DZE_BuildingLimit = 250; // установить лимит объектов
};
	s_player_SurrenderedGear = -1; //найти
s_player_maintain_area = -1; //добавить
s_player_maintain_area_preview = -1; //добавить
s_player_maintain_area_count = -1; //добавить

fn_selfActions.sqf
	 if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "Plastic_Pole_EP1_DZ")) then {
if (s_player_maintain_area < 0) then {
  s_player_maintain_area = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTAREA"], "\z\addons\dayz_code\actions\maintain_area.sqf", "maintain", 5, false];
s_player_maintain_area_preview = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTPREV"], "\z\addons\dayz_code\actions\maintain_area.sqf", "preview", 5, false];
s_player_maintain_area_count = player addaction [("<t color=""#ff0000"">" + ("Количество построек") +"</t>"),"custom\countpole.sqf",_cursorTarget,1,false,true,"",""]; //добавить
};
} else {
    player removeAction s_player_maintain_area;
    s_player_maintain_area = -1;
    player removeAction s_player_maintain_area_preview;
    s_player_maintain_area_preview = -1;
    player removeAction s_player_maintain_area_count; //добавить
    s_player_maintain_area_count = -1; //добавить
};
	player removeAction s_player_flipveh; //найти
s_player_flipveh = -1; //найти
player removeAction s_player_maintain_area; //добавить
s_player_maintain_area = -1; //добавить
player removeAction s_player_maintain_area_preview; //добавить
s_player_maintain_area_preview = -1; //добавить
player removeAction s_player_maintain_area_count; //добавить
s_player_maintain_area_count = -1; //добавить

countpole.sqf
private ["_countpole","_limited","_distance"];

_distance = 35; //установить значение идентичное DZE_PlotPole (+5)
_limited = 250; //установить значение идентичное DZE_BuildingLimit
_countpole = count (nearestObjects [player, [
"BagFenceRound_DZ"
,"BearTrap_DZ"
,"CanvasHut_DZ"
,"CinderWallDoorLocked_DZ"
,"CinderWallDoorSmallLocked_DZ"
,"CinderWallDoorSmall_DZ"
,"CinderWallDoor_DZ"
,"CinderWallDoorway_DZ"
,"CinderWallHalf_DZ"
,"CinderWallSmallDoorway_DZ"
,"CinderWall_DZ"
,"DeerStand_DZ"
,"DesertCamoNet_DZ"
,"DesertLargeCamoNet_DZ"
,"Fence_corrugated_DZ"
,"FireBarrel_DZ"
,"ForestCamoNet_DZ"
,"ForestLargeCamoNet_DZ"
,"Fort_RazorWire"
,"FuelPump_DZ"
,"Generator_DZ"
,"GunRack_DZ"
,"Hedgehog_DZ"
,"Land_DZE_GarageWoodDoor"
,"Land_DZE_GarageWoodDoorLocked"
,"Land_DZE_LargeWoodDoor"
,"Land_DZE_LargeWoodDoorLocked"
,"Land_DZE_WoodDoor"
,"Land_DZE_WoodDoorLocked"
,"Land_HBarrier1_DZ"
,"Land_HBarrier3_DZ"
,"Land_HBarrier5_DZ"
,"LightPole_DZ"
,"LockboxStorageLocked"
,"M240Nest_DZ"
,"MetalFloor_DZ"
,"MetalGate_DZ"
,"MetalPanel_DZ"
,"OutHouse_DZ"
,"ParkBench_DZ"
,"Plastic_Pole_EP1_DZ"
,"SandNest_DZ"
,"Sandbag1_DZ"
,"Scaffolding_DZ"
,"StickFence_DZ"
,"StorageShed_DZ"
,"TentStorage"
,"TentStorageDomed"
,"TentStorageDomed2"
,"TrapBear"
,"VaultStorageLocked"
,"WoodCrate_DZ"
,"WoodFloorHalf_DZ"
,"WoodFloorQuarter_DZ"
,"WoodFloor_DZ"
,"WoodGate_DZ"
,"WoodLadder_DZ"
,"WoodLargeWallDoor_DZ"
,"WoodLargeWallWin_DZ"
,"WoodLargeWall_DZ"
,"WoodRamp_DZ"
,"WoodShack_DZ"
,"WoodSmallWallDoor_DZ"
,"WoodSmallWallThird_DZ"
,"WoodSmallWallWin_DZ"
,"WoodSmallWall_DZ"
,"WoodStairsRails_DZ"
,"WoodStairsSans_DZ"
,"WoodStairs_DZ"
,"Wooden_shed_DZ"
,"WorkBench_DZ"
], _distance]);

if (_countpole > 0) then {
titleText [format["\n Количество построенных объектов: %1 \n Можно построить еще: %2 ",_countpole,(_limited - _countpole)], "PLAIN DOWN"];
player removeAction s_player_maintain_area_count;
s_player_maintain_area_count = -1;
} else {
titleText [format["\n Количество построенных объектов: 0 \n Можно построить еще: %1 ",_limited], "PLAIN DOWN"];
player removeAction s_player_maintain_area_count;
s_player_maintain_area_count = -1;
};

AHconfig.sqf
_dayzActions =
[
"s_player_maintain_area_count"  //добавить
];

7
init.sqf
DZE_ConfigTrader = true; //добавить

compiles.sqf
		call compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_traderMenuConfig.sqf"; //найти
call compile preprocessFileLineNumbers "fixes\player_traderMenuConfig.sqf"; //заменить

call compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_traderMenuHive.sqf"; //найти
call compile preprocessFileLineNumbers "fixes\player_traderMenuHive.sqf"; //заменить

player_traderMenuConfig.sqf
		_File = "\z\addons\dayz_code\actions\" + _afile + ".sqf"; //найти
_File = "fixes\trade\" + _afile + ".sqf"; //заменить
player_traderMenuHive.sqf
		_File = "\z\addons\dayz_code\actions\" + _afile + ".sqf"; //найти
_File = "fixes\trade\" + _afile + ".sqf"; //заменить

fixes\trade\trade_any_bicycle.sqf
private ["_veh","_location","_isOk","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_obj","_objectID","_objectUID","_bos","_started","_finished","_animState","_isMedic","_dir","_helipad","_keyColor","_keyNumber","_keySelected","_isKeyOK","_config","_damage","_tireDmg","_tires","_okToSell","_hitpoints","_needed","_activatingPlayer","_textPartIn","_textPartOut","_traderID","_canAfford","_trade_total","_total_currency","_return_change","_done"];


DZE_ActionInProgress = true;

// Test cannot lock while another player is nearby
//_playerNear = {isPlayer _x} count (player nearEntities ["CAManBase", 12]) > 1;
//if(_playerNear) exitWith { DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_104") , "PLAIN DOWN"];  };

// [part_out,part_in, qty_out, qty_in, loc];

_activatingPlayer = player;

_part_out = (_this select 3) select 0;
_part_in = (_this select 3) select 1;
_qty_out = (_this select 3) select 2;
_qty_in = (_this select 3) select 3;
_buy_o_sell = (_this select 3) select 4;
_textPartIn = (_this select 3) select 5;
_textPartOut = (_this select 3) select 6;
_traderID = (_this select 3) select 7;
_bos = 0;

if(_buy_o_sell == "sell") then {
_bos = 1;
};

cutText [(localize "str_epoch_player_105"), "PLAIN DOWN"];
//player playActionNow "PutDown"; //Анимация отключена
_canAfford = false;
if(_bos == 1) then {

_distance = dayz_sellDistance_vehicle;
if (_part_in isKindOf "Air") then {
_distance = dayz_sellDistance_air;
};
if (_part_in isKindOf "Ship") then {
_distance = dayz_sellDistance_boat;
};
_count = {(typeOf _x) == _part_in} count (nearestObjects [(getPosATL player), [_part_in], _distance]);
if (_count >= _qty_in) then {
_canAfford = true;
};
diag_log format["DEBUG vehicle sell count: %1", _count];

} else {

//buy
_trade_total = [[_part_in,_qty_in]] call epoch_itemCost;
_total_currency = call epoch_totalCurrency;
_return_change = _total_currency - _trade_total;
if (_return_change >= 0) then {
_canAfford = true;
};
};


if (_canAfford) then {

//["PVDZE_obj_Trade",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
// if (isNil "_obj") then { _obj = "Unknown Vehicle" };
if (isNil "inTraderCity") then { inTraderCity = "Unknown Trader City" };
if(_bos == 1) then {
// Selling
PVDZE_obj_Trade = [_activatingPlayer,_traderID,_bos,_part_in,inTraderCity,_part_out,_qty_out];
} else {
// Buying
PVDZE_obj_Trade = [_activatingPlayer,_traderID,_bos,_part_out,inTraderCity,_part_in,_qty_in];
};
publicVariableServer  "PVDZE_obj_Trade";

//diag_log format["DEBUG Starting to wait for answer: %1", PVDZE_obj_Trade];

if(_buy_o_sell == "buy") then {

waitUntil {!isNil "dayzTradeResult"};

//diag_log format["DEBUG Complete Trade: %1", dayzTradeResult];

if(dayzTradeResult == "PASS") then {

_done = [[[_part_in,_qty_in]],0] call epoch_returnChange;
if (_done) then {

// spawn vehicle
_dir = round(random 360);

_helipad = nearestObjects [player, ["HeliHCivil","HeliHempty"], 100];
if(count _helipad > 0) then {
_location = (getPosATL (_helipad select 0));
} else {
_location = [(position player),0,20,1,0,2000,0] call BIS_fnc_findSafePos;
};

//place vehicle spawn marker (local)
_veh = createVehicle ["Sign_arrow_down_large_EP1", _location, [], 0, "CAN_COLLIDE"];

_location = (getPosATL _veh);

//["PVDZE_veh_Publish",[_veh,[_dir,_location],_part_out,false,_keySelected]] call callRpcProcedure;
PVDZE_veh_Publish2 = [_veh,[_dir,_location],_part_out,true,dayz_characterID,_activatingPlayer];
publicVariableServer  "PVDZE_veh_Publish2";

cutText [format[(localize "STR_EPOCH_PLAYER_180"),_qty_in,_textPartIn,_textPartOut], "PLAIN DOWN"];
};

} else {
cutText [format[(localize "str_epoch_player_183"),_textPartOut] , "PLAIN DOWN"];
};
} else {

//sell
_distance = dayz_sellDistance_vehicle;
if (_part_in isKindOf "Air") then {
_distance = dayz_sellDistance_air;
};
if (_part_in isKindOf "Ship") then {
_distance = dayz_sellDistance_boat;
};

_objects = nearestObjects [(getPosATL player), [_part_in], _distance];

diag_log format["DEBUG vehicle sell objects: %1", _objects];

_qty = ({(typeOf _x) == _part_in} count _objects);

if (_qty >= _qty_in) then {

_obj = (_objects select 0);

//check to make sure vehicle has no more than 75% average tire damage
_hitpoints = _obj call vehicle_getHitpoints;
_okToSell = true;

// count parts
_tires = 0;

// total damage
_tireDmg = 0;

_damage = 0;
{
if(["Wheel",_x,false] call fnc_inString) then {
_damage = [_obj,_x] call object_getHit;
_tireDmg = _tireDmg + _damage;
_tires = _tires + 1;
};
} forEach _hitpoints;

// find average tire damage
if(_tireDmg > 0 and _tires > 0) then {
if((_tireDmg / _tires) > 0.75) then {
_okToSell = false;
};
};

_objectID = _obj getVariable ["ObjectID","0"];
_objectUID = _obj getVariable ["ObjectUID","0"];

_notSetup = (_objectID == "0" && _objectUID == "0");

if(local _obj and !isNull _obj and alive _obj and !_notSetup) then {

if(_okToSell) then {



//if(_objectID != "0" && _objectUID != "0") then {

PVDZE_obj_Delete = [_objectID,_objectUID,_activatingPlayer];
publicVariableServer "PVDZE_obj_Delete";

deleteVehicle _obj;

// payout
_canAfford = [[[_part_out,_qty_out]],1] call epoch_returnChange;

cutText [format[(localize "str_epoch_player_181"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];


} else {
cutText [format[(localize "str_epoch_player_182"),_textPartIn] , "PLAIN DOWN"];
};
} else {
cutText [(localize "str_epoch_player_245"), "PLAIN DOWN"];
};
};
};
dayzTradeResult = nil;
} else {

if(_buy_o_sell == "buy") then {
_qty = {_x == _part_in} count magazines player;
_needed =  _qty_in - _qty;
cutText [format[(localize "str_epoch_player_184"),_needed,_textPartIn] , "PLAIN DOWN"];
} else {
cutText [format[(localize "str_epoch_player_185"),_textPartIn] , "PLAIN DOWN"];
};
};
DZE_ActionInProgress = false;

fixes\trade\trade_any_boat.sqf
private ["_veh","_location","_isOk","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_obj","_objectID","_objectUID","_bos","_started","_finished","_animState","_isMedic","_dir","_helipad","_keyColor","_keyNumber","_keySelected","_isKeyOK","_config","_damage","_tireDmg","_tires","_okToSell","_hitpoints","_needed","_activatingPlayer","_textPartIn","_textPartOut","_traderID","_canAfford","_trade_total","_total_currency","_return_change","_done"];


DZE_ActionInProgress = true;

// Test cannot lock while another player is nearby
//_playerNear = {isPlayer _x} count (player nearEntities ["CAManBase", 12]) > 1;
//if(_playerNear) exitWith { DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_104") , "PLAIN DOWN"];  };

// [part_out,part_in, qty_out, qty_in, loc];

_activatingPlayer = player;

_part_out = (_this select 3) select 0;
_part_in = (_this select 3) select 1;
_qty_out = (_this select 3) select 2;
_qty_in = (_this select 3) select 3;
_buy_o_sell = (_this select 3) select 4;
_textPartIn = (_this select 3) select 5;
_textPartOut = (_this select 3) select 6;
_traderID = (_this select 3) select 7;
_bos = 0;

if(_buy_o_sell == "sell") then {
_bos = 1;
};

cutText [(localize "str_epoch_player_105"), "PLAIN DOWN"];
//player playActionNow "PutDown"; //Анимация отключена


_canAfford = false;
if(_bos == 1) then {

_distance = dayz_sellDistance_vehicle;
if (_part_in isKindOf "Air") then {
_distance = dayz_sellDistance_air;
};
if (_part_in isKindOf "Ship") then {
_distance = dayz_sellDistance_boat;
};
_count = {(typeOf _x) == _part_in} count (nearestObjects [(getPosATL player), [_part_in], _distance]);
if (_count >= _qty_in) then {
_canAfford = true;
};
diag_log format["DEBUG vehicle sell count: %1", _count];

} else {

//buy
_trade_total = [[_part_in,_qty_in]] call epoch_itemCost;
_total_currency = call epoch_totalCurrency;
_return_change = _total_currency - _trade_total;
if (_return_change >= 0) then {
_canAfford = true;
};
};


if (_canAfford) then {

//["PVDZE_obj_Trade",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
// if (isNil "_obj") then { _obj = "Unknown Vehicle" };
if (isNil "inTraderCity") then { inTraderCity = "Unknown Trader City" };
if(_bos == 1) then {
// Selling
PVDZE_obj_Trade = [_activatingPlayer,_traderID,_bos,_part_in,inTraderCity,_part_out,_qty_out];
} else {
// Buying
PVDZE_obj_Trade = [_activatingPlayer,_traderID,_bos,_part_out,inTraderCity,_part_in,_qty_in];
};
publicVariableServer  "PVDZE_obj_Trade";

//diag_log format["DEBUG Starting to wait for answer: %1", PVDZE_obj_Trade];

if(_buy_o_sell == "buy") then {

waitUntil {!isNil "dayzTradeResult"};

//diag_log format["DEBUG Complete Trade: %1", dayzTradeResult];

if(dayzTradeResult == "PASS") then {

// First select key color
_keyColor = ["Green","Red","Blue","Yellow","Black"] call BIS_fnc_selectRandom;

// then select number from 1 - 2500
_keyNumber = (floor(random 2500)) + 1;

// Combine to key (eg.ItemKeyYellow2494) classname
_keySelected = format[("ItemKey%1%2"),_keyColor,_keyNumber];

_isKeyOK = isClass(configFile >> "CfgWeapons" >> _keySelected);

_config = _keySelected;
_isOk = [player,_config] call BIS_fnc_invAdd;

waitUntil {!isNil "_isOk"};

if (_isOk and _isKeyOK) then {

_done = [[[_part_in,_qty_in]],0] call epoch_returnChange;
if (_done) then {

// spawn vehicle
_dir = round(random 360);

_helipad = nearestObjects [player, ["HeliHCivil","HeliHempty"], 100];
if(count _helipad > 0) then {
_location = (getPosATL (_helipad select 0));
} else {
_location = [(position player),0,20,1,2,2000,0] call BIS_fnc_findSafePos;
};

//place vehicle spawn marker (local)
_veh = createVehicle ["Sign_arrow_down_large_EP1", _location, [], 0, "CAN_COLLIDE"];

_location = (getPosATL _veh);

//["PVDZE_veh_Publish",[_veh,[_dir,_location],_part_out,false,_keySelected]] call callRpcProcedure;
PVDZE_veh_Publish2 = [_veh,[_dir,_location],_part_out,false,_keySelected,_activatingPlayer];
publicVariableServer  "PVDZE_veh_Publish2";

cutText [format[(localize "STR_EPOCH_ACTIONS_11"),_qty_in,_textPartIn,_textPartOut], "PLAIN DOWN"];
};
} else {
cutText [(localize "str_epoch_player_107"), "PLAIN DOWN"];
};

} else {
cutText [format[(localize "str_epoch_player_183"),_textPartOut] , "PLAIN DOWN"];
};
} else {

//sell
_distance = dayz_sellDistance_vehicle;
if (_part_in isKindOf "Air") then {
_distance = dayz_sellDistance_air;
};
if (_part_in isKindOf "Ship") then {
_distance = dayz_sellDistance_boat;
};

_objects = nearestObjects [(getPosATL player), [_part_in], _distance];

diag_log format["DEBUG vehicle sell objects: %1", _objects];

_qty = ({(typeOf _x) == _part_in} count _objects);

if (_qty >= _qty_in) then {

_obj = (_objects select 0);

_objectID = _obj getVariable ["ObjectID","0"];
_objectUID = _obj getVariable ["ObjectUID","0"];

_notSetup = (_objectID == "0" && _objectUID == "0");

if(local _obj and !isNull _obj and alive _obj and !_notSetup) then {

PVDZE_obj_Delete = [_objectID,_objectUID,_activatingPlayer];
publicVariableServer "PVDZE_obj_Delete";

deleteVehicle _obj;

// payout
_canAfford = [[[_part_out,_qty_out]],1] call epoch_returnChange;

cutText [format[(localize "str_epoch_player_181"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];

} else {
cutText [(localize "str_epoch_player_245"), "PLAIN DOWN"];
};
};
};
dayzTradeResult = nil;
} else {

if(_buy_o_sell == "buy") then {
_qty = {_x == _part_in} count magazines player;
_needed =  _qty_in - _qty;
cutText [format[(localize "str_epoch_player_184"),_needed,_textPartIn] , "PLAIN DOWN"];
} else {
cutText [format[(localize "str_epoch_player_185"),_textPartIn] , "PLAIN DOWN"];
};
};
DZE_ActionInProgress = false;

fixes\trade\trade_any_vehicle.sqf
private ["_veh","_location","_isOk","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_obj","_objectID","_objectUID","_bos","_started","_finished","_animState","_isMedic","_dir","_helipad","_keyColor","_keyNumber","_keySelected","_isKeyOK","_config","_damage","_tireDmg","_tires","_okToSell","_temp_keys","_hitpoints","_needed","_activatingPlayer","_textPartIn","_textPartOut","_traderID","_canAfford","_trade_total","_total_currency","_return_change","_done"];


DZE_ActionInProgress = true;

// Test cannot lock while another player is nearby
//_playerNear = {isPlayer _x} count (player nearEntities ["CAManBase", 12]) > 1;
//if(_playerNear) exitWith { DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_104") , "PLAIN DOWN"];  };

// [part_out,part_in, qty_out, qty_in, loc];

_activatingPlayer = player;

_part_out = (_this select 3) select 0;
_part_in = (_this select 3) select 1;
_qty_out = (_this select 3) select 2;
_qty_in = (_this select 3) select 3;
_buy_o_sell = (_this select 3) select 4;
_textPartIn = (_this select 3) select 5;
_textPartOut = (_this select 3) select 6;
_traderID = (_this select 3) select 7;
_bos = 0;

if(_buy_o_sell == "sell") then {
_bos = 1;
};

cutText [(localize "str_epoch_player_105"), "PLAIN DOWN"];

//player playActionNow "PutDown"; //Анимация отключена

_canAfford = false;
if(_bos == 1) then {

_distance = dayz_sellDistance_vehicle;
if (_part_in isKindOf "Air") then {
_distance = dayz_sellDistance_air;
};
if (_part_in isKindOf "Ship") then {
_distance = dayz_sellDistance_boat;
};
_count = {(typeOf _x) == _part_in} count (nearestObjects [(getPosATL player), [_part_in], _distance]);
if (_count >= _qty_in) then {
_canAfford = true;
};
diag_log format["DEBUG vehicle sell count: %1", _count];

} else {

//buy
_trade_total = [[_part_in,_qty_in]] call epoch_itemCost;
_total_currency = call epoch_totalCurrency;
_return_change = _total_currency - _trade_total;
if (_return_change >= 0) then {
_canAfford = true;
};
};


if (_canAfford) then {

//["PVDZE_obj_Trade",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
// if (isNil "_obj") then { _obj = "Unknown Vehicle" };
if (isNil "inTraderCity") then { inTraderCity = "Unknown Trader City" };
if(_bos == 1) then {
// Selling
PVDZE_obj_Trade = [_activatingPlayer,_traderID,_bos,_part_in,inTraderCity,_part_out,_qty_out];
} else {
// Buying
PVDZE_obj_Trade = [_activatingPlayer,_traderID,_bos,_part_out,inTraderCity,_part_in,_qty_in];
};
publicVariableServer  "PVDZE_obj_Trade";

//diag_log format["DEBUG Starting to wait for answer: %1", PVDZE_obj_Trade];

if(_buy_o_sell == "buy") then {

waitUntil {!isNil "dayzTradeResult"};

//diag_log format["DEBUG Complete Trade: %1", dayzTradeResult];

if(dayzTradeResult == "PASS") then {

// First select key color
_keyColor = ["Green","Red","Blue","Yellow","Black"] call BIS_fnc_selectRandom;

// then select number from 1 - 2500
_keyNumber = (floor(random 2500)) + 1;

// Combine to key (eg.ItemKeyYellow2494) classname
_keySelected = format[("ItemKey%1%2"),_keyColor,_keyNumber];

_isKeyOK = isClass(configFile >> "CfgWeapons" >> _keySelected);

_config = _keySelected;
_isOk = [player,_config] call BIS_fnc_invAdd;

waitUntil {!isNil "_isOk"};

if (_isOk and _isKeyOK) then {

_done = [[[_part_in,_qty_in]],0] call epoch_returnChange;
if (_done) then {

// spawn vehicle
_dir = round(random 360);

_helipad = nearestObjects [player, ["HeliHCivil","HeliHempty"], 100];
if(count _helipad > 0) then {
_location = (getPosATL (_helipad select 0));
} else {
_location = [(position player),0,20,1,0,2000,0] call BIS_fnc_findSafePos;
};

//place vehicle spawn marker (local)
_veh = createVehicle ["Sign_arrow_down_large_EP1", _location, [], 0, "CAN_COLLIDE"];

_location = (getPosATL _veh);

//["PVDZE_veh_Publish",[_veh,[_dir,_location],_part_out,false,_keySelected]] call callRpcProcedure;
PVDZE_veh_Publish2 = [_veh,[_dir,_location],_part_out,false,_keySelected,_activatingPlayer];
publicVariableServer  "PVDZE_veh_Publish2";

cutText [format[(localize "STR_EPOCH_ACTIONS_11"),_qty_in,_textPartIn,_textPartOut], "PLAIN DOWN"];
};
} else {
cutText [(localize "str_epoch_player_107"), "PLAIN DOWN"];
};

} else {
cutText [format[(localize "str_epoch_player_183"),_textPartOut] , "PLAIN DOWN"];
};
} else {

//sell
_distance = dayz_sellDistance_vehicle;
if (_part_in isKindOf "Air") then {
_distance = dayz_sellDistance_air;
};
if (_part_in isKindOf "Ship") then {
_distance = dayz_sellDistance_boat;
};

_objects = nearestObjects [(getPosATL player), [_part_in], _distance];

diag_log format["DEBUG vehicle sell objects: %1", _objects];

_qty = ({(typeOf _x) == _part_in} count _objects);

if (_qty >= _qty_in) then {

_obj = (_objects select 0);

//check to make sure vehicle has no more than 75% average tire damage
_hitpoints = _obj call vehicle_getHitpoints;
_okToSell = true;

// count parts
_tires = 0;

// total damage
_tireDmg = 0;

_damage = 0;
{
if(["Wheel",_x,false] call fnc_inString) then {
_damage = [_obj,_x] call object_getHit;
_tireDmg = _tireDmg + _damage;
_tires = _tires + 1;
};
} forEach _hitpoints;

// find average tire damage
if(_tireDmg > 0 and _tires > 0) then {
if((_tireDmg / _tires) > 0.75) then {
_okToSell = false;
};
};

_objectID = _obj getVariable ["ObjectID","0"];
_objectUID = _obj getVariable ["ObjectUID","0"];
_objectCharacterId = _obj getVariable ["CharacterID","0"];

_notSetup = (_objectID == "0" && _objectUID == "0");

if(local _obj and !isNull _obj and alive _obj and !_notSetup) then {

if(_okToSell) then {

//if(_objectID != "0" && _objectUID != "0") then {

PVDZE_obj_Delete = [_objectID,_objectUID,_activatingPlayer];
publicVariableServer "PVDZE_obj_Delete";

deleteVehicle _obj;

// remove Key
_temp_keys = [];
_keyColor = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
{
if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _x)) in _key_colors) then {
if (getNumber(configFile >> "CfgWeapons" >> _x >> "keyid") == _objectCharacterId) then {
[_activatingPlayer,_x] call BIS_fnc_invRemove;
};
};
} forEach (items _activatingPlayer);

// payout
_canAfford = [[[_part_out,_qty_out]],1] call epoch_returnChange;

cutText [format[(localize "str_epoch_player_181"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];


} else {
cutText [format[(localize "str_epoch_player_182"),_textPartIn] , "PLAIN DOWN"];
};
} else {
cutText [(localize "str_epoch_player_245"), "PLAIN DOWN"];
};
};
};
dayzTradeResult = nil;
} else {
if(_buy_o_sell == "buy") then {
_qty = {_x == _part_in} count magazines player;
_needed =  _qty_in - _qty;
cutText [format[(localize "str_epoch_player_184"),_needed,_textPartIn] , "PLAIN DOWN"];
} else {
cutText [format[(localize "str_epoch_player_185"),_textPartIn] , "PLAIN DOWN"];
};
};

DZE_ActionInProgress = false;

fixes\trade\trade_backpacks.sqf
private ["_part_out","_part_in","_qty_out","_qty_in","_qty","_bos","_bag","_class","_started","_finished","_animState","_isMedic","_num_removed","_needed","_activatingPlayer","_buy_o_sell","_textPartIn","_textPartOut","_traderID"];
//    [part_out,part_in, qty_out, qty_in,];


DZE_ActionInProgress = true;

_activatingPlayer = player;

diag_log format["DEBUG BACKPACK: %1", _this];

_part_out = (_this select 3) select 0;
_part_in = (_this select 3) select 1;
_qty_out = (_this select 3) select 2;
_qty_in = (_this select 3) select 3;
_buy_o_sell = (_this select 3) select 4;
_textPartIn = (_this select 3) select 5;
_textPartOut = (_this select 3) select 6;
_traderID = (_this select 3) select 7;

_bos = 0;
if(_buy_o_sell == "sell") then {
_bos = 1;
};

cutText [(localize "str_epoch_player_105"), "PLAIN DOWN"];
//player playActionNow "PutDown"; //Анимация отключена

_canAfford = false;
if(_bos == 1) then {

//sell
_qty = 0;
_bag = unitBackpack player;
_class = typeOf _bag;
if(_class == _part_in) then {
_qty = 1;
};
if (_qty >= _qty_in) then {
if((typeOf (unitBackpack player)) == _part_in) then {
removeBackpack player;
_canAfford = [[[_part_out,_qty_out]],1] call epoch_returnChange;
};
};

} else {

//buy
_trade_total = [[_part_in,_qty_in]] call epoch_itemCost;
_total_currency = call epoch_totalCurrency;
_return_change = _total_currency - _trade_total;
if (_return_change >= 0) then {
_canAfford = true;
};
};

if (_canAfford) then {

//["PVDZE_obj_Trade",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
if (isNil "_bag") then { _bag = "Unknown Backpack" };
if (isNil "inTraderCity") then { inTraderCity = "Unknown Trader City" };
if(_bos == 1) then {
// Selling
PVDZE_obj_Trade = [_activatingPlayer,_traderID,_bos,_part_in,inTraderCity,_part_out,_qty_out];
} else {
// Buying
PVDZE_obj_Trade = [_activatingPlayer,_traderID,_bos,_part_out,inTraderCity,_part_in,_qty_in];
};
publicVariableServer  "PVDZE_obj_Trade";

if(_bos == 0) then {

waitUntil {!isNil "dayzTradeResult"};

//diag_log format["DEBUG Complete Trade: %1", dayzTradeResult];

if(dayzTradeResult == "PASS") then {

_done = [[[_part_in,_qty_in]],0] call epoch_returnChange;
if (_done) then {
removeBackpack player;
player addBackpack _part_out;
cutText [format[(localize "str_epoch_player_186"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
};

} else {
cutText [format[(localize "str_epoch_player_183"),_textPartOut] , "PLAIN DOWN"];
};

} else {
cutText [format[(localize "str_epoch_player_186"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
};
dayzTradeResult = nil;
} else {
_needed =  _qty_in - _qty;
cutText [format[(localize "str_epoch_player_184"),_needed,_textPartIn] , "PLAIN DOWN"];
};


DZE_ActionInProgress = false;

fixes\trade\trade_cancel.sqf
private [];
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
s_player_parts_crtl = -1;

fixes\trade\trade_items.sqf
private ["_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_textPartIn","_textPartOut","_bos","_needed","_started","_finished","_animState","_isMedic","_total_parts_out","_abort","_removed","_activatingPlayer","_traderID","_done"];
// [part_out,part_in, qty_out, qty_in,];
 
if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_103") , "PLAIN DOWN"] };
DZE_ActionInProgress = true;
 
_activatingPlayer = player;
 
_part_out = (_this select 3) select 0;
_part_in = (_this select 3) select 1;
_qty_out = (_this select 3) select 2;
_qty_in = (_this select 3) select 3;
_buy_o_sell = (_this select 3) select 4;
_textPartIn = (_this select 3) select 5;
_textPartOut = (_this select 3) select 6;
_traderID = (_this select 3) select 7;
 
_bos = 0;
if(_buy_o_sell == "sell") then {
        _bos = 1;
};
 
_abort = false;
 
// perform number of total trades
r_autoTrade = true;
while {r_autoTrade} do {
 
        _removed = 0;
        cutText [(localize "str_epoch_player_105"), "PLAIN DOWN"];
         
      r_interrupt = false;
        r_doLoop = true;
        _started = false;
        _finished = false;
       
 
        //////////////
       
            _position = getPos player; // gets the position [x,y,z]
        _posX = _position select 0; // 1th element -> x
        _posY = _position select 1; // 2nd element -> y
 
        _counter = 0.0; // animation duration checker
       
        while {r_doLoop} do {
                _positionCheck = getPos player;
                _newX = _positionCheck select 0; // 1th element -> x
                _newY = _positionCheck select 1; // 2nd element -> y
 
                _counter = _counter + 0.1; // same as the sleep timer: 0.1 sec
 
                if (_counter >  1.5) then { // amount of secs the animation takes estimated ? 2 secs?
                        r_doLoop = false;
                                                _counter = 0.0;
                        _finished = true;
                                               
                };
                if (_newX != _posX || _newY != _posY) then {
                                               
                        r_doLoop = false;
                };
                sleep 0.1;
        };
        r_doLoop = false;
 
        if (!_finished) exitWith {
                r_interrupt = false;
                if (vehicle player == player) then {
                        [objNull, player, rSwitchMove,""] call RE;
                        player playActionNow "stop";
                };
                cutText [(localize "str_epoch_player_106") , "PLAIN DOWN"];
        };
 
        if (_finished) then {
               
                _canAfford = false;
                if(_bos == 1) then {
                       
                        //sell
                        _qty = {_x == _part_in} count magazines player;
                        if (_qty >= _qty_in) then {
                                _part_inClass =  configFile >> "CfgMagazines" >> _part_in;
                                _removed = _removed + ([player,_part_inClass,_qty_in] call BIS_fnc_invRemove);
                                if (_removed == _qty_in) then {
                                        _canAfford = [[[_part_out,_qty_out]],1] call epoch_returnChange;
                                };
                        };
 
                } else {
                       
                        //buy
                        _trade_total = [[_part_in,_qty_in]] call epoch_itemCost;
                        _total_currency = call epoch_totalCurrency;
                        _return_change = _total_currency - _trade_total;
                        if (_return_change >= 0) then {
                                _canAfford = true;
                        };
                };
 
                diag_log format["DEBUG TRADER DONE?: %1", _canAfford];
               
                if (_canAfford) then {
                       
                        // Continue with trade.
                        if (isNil "_part_in") then { _part_in = "Unknown Item" };
                        if (isNil "inTraderCity") then { inTraderCity = "Unknown Trader City" };
                        if(_bos == 1) then {
                                // Selling
                                PVDZE_obj_Trade = [_activatingPlayer,_traderID,_bos,_part_in,inTraderCity,_part_out,_qty_out];
                        } else {
                                // Buying
                                PVDZE_obj_Trade = [_activatingPlayer,_traderID,_bos,_part_out,inTraderCity,_part_in,_qty_in];
                        };
                        publicVariableServer  "PVDZE_obj_Trade";
 
                        if(_bos == 0) then {
                                // only wait for result when buying
                                waitUntil {!isNil "dayzTradeResult"};
                                if(dayzTradeResult == "PASS") then {
                                        _done = [[[_part_in,_qty_in]],0] call epoch_returnChange;
                                        if (_done) then {
                                                for "_x" from 1 to _qty_out do {
                                                        player addMagazine _part_out;
                                                };
                                                cutText [format[(localize "str_epoch_player_186"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
                                        };
                                } else {
                                        _abort = true;
                                        cutText [format[(localize "str_epoch_player_183"),_textPartOut] , "PLAIN DOWN"];
                                };
                        } else {
                                cutText [format[(localize "str_epoch_player_186"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
                        };
                        dayzTradeResult = nil;
                       
                } else {
                        _qty = {_x == _part_in} count magazines player;
                        _needed =  _qty_in - _qty;
                        cutText [format[(localize "str_epoch_player_184"),_needed,_textPartIn] , "PLAIN DOWN"];
                        _abort = true;
                };
        };
        if(_abort) exitWith {r_autoTrade = false};
       
        sleep 1;
};
 
DZE_ActionInProgress = false;

fixes\trade\trade_items_wo_db.sqf
private ["_part_out","_part_in","_qty_out","_qty_in","_textPartIn","_textPartOut","_qty","_needed","_started","_finished","_animState","_isMedic","_abort","_removed","_tradeCounter","_total_trades","_humanityGain","_humanity"];
// [part_out,part_in, qty_out, qty_in,];

if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_103") , "PLAIN DOWN"]; };
DZE_ActionInProgress = true;

//_activatingPlayer = getPlayerUID player;

_part_out = (_this select 3) select 0;
_part_in = (_this select 3) select 1;
_qty_out = (_this select 3) select 2;
_qty_in = (_this select 3) select 3;
// _buy_o_sell = (_this select 3) select 4;
_textPartIn = (_this select 3) select 5;
_textPartOut = (_this select 3) select 6;
//_traderID = (_this select 3) select 7;

_qty = {_x == _part_in} count magazines player;

// find total number of possible trades
_total_trades = floor (_qty / _qty_in);

if(_total_trades < 1) exitWith {
_needed =  _qty_in - _qty;
cutText [format[(localize "str_epoch_player_184"),_needed,_textPartIn] , "PLAIN DOWN"];
DZE_ActionInProgress = false;
};

_abort = false;
_tradeCounter = 0;

// trade all items
for "_x" from 1 to _total_trades do {

_removed = 0;

_tradeCounter = _tradeCounter + 1;

if(_total_trades == 1) then {
cutText [format[(localize "str_epoch_player_105"),_tradeCounter,_total_trades] , "PLAIN DOWN"];
} else {
cutText [format[(localize "str_epoch_player_187"),_tradeCounter,_total_trades] , "PLAIN DOWN"];
};

[1,1] call dayz_HungerThirst;
// player playActionNow "PutDown"; //Анимация отключена
// sleep 2;

_qty = {_x == _part_in} count magazines player;
if (_qty >= _qty_in) then {

_removed = _removed + ([player,_part_in,_qty_in] call BIS_fnc_invRemove);
if (_removed == _qty_in) then {

_humanityGain = 0;
for "_x" from 1 to _qty_out do {
player addMagazine _part_out;
if(_part_out == "FoodBioMeat") then {
_humanityGain = _humanityGain + 20;
};
};

if(_humanityGain > 0) then {
// Increase humanity for turning in bio meat
_humanity = player getVariable["humanity",0];
_humanity = _humanity + _humanityGain;
player setVariable["humanity",_humanity,true];
};

cutText [format[(localize "str_epoch_player_186"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];

} else {

// Return items from botched trade.
for "_x" from 1 to _removed do {
player addMagazine _part_in;
};
_abort = true;
};

} else {
_needed =  _qty_in - _qty;
cutText [format[(localize "str_epoch_player_184"),_needed,_textPartIn] , "PLAIN DOWN"];
};

sleep 1;

if(_abort) exitWith {};
};


DZE_ActionInProgress = false;

fixes\trade\trade_metals.sqf
private ["_buy","_metals_conversion","_cancel"];

if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_103") , "PLAIN DOWN"]; };
DZE_ActionInProgress = true;

{player removeAction _x} forEach s_player_parts;s_player_parts = [];
s_player_parts_crtl = 1;

_metals_conversion = [
["ItemGoldBar","ItemSilverBar10oz",1,10,"buy","10oz Silver","Gold",102],
["ItemSilverBar10oz","ItemGoldBar",10,1,"buy","Gold","10oz Silver",101],
["ItemBriefcase100oz","ItemGoldBar10oz",1,12,"buy","10oz Gold","Full Briefcase",99]
];

// Static Menu
{
//diag_log format["DEBUG TRADER: %1", _x];
_buy = player addAction [format["Trade %1 %2 for %3 %4",(_x select 3),(_x select 5),(_x select 2),(_x select 6)], "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",[(_x select 0),(_x select 1),(_x select 2),(_x select 3),(_x select 4),(_x select 5),(_x select 6)], (_x select 7), true, true, "",""];
s_player_parts set [count s_player_parts,_buy];

} forEach _metals_conversion;

_cancel = player addAction ["Cancel", "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""];
s_player_parts set [count s_player_parts,_cancel];

DZE_ActionInProgress = false;

fixes\trade\trade_weapons.sqf
private ["_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_traderID","_bos","_needed","_activatingPlayer","_textPartIn","_textPartOut","_started","_finished","_animState","_isMedic","_removed"];
// [part_out,part_in, qty_out, qty_in,"buy"];


DZE_ActionInProgress = true;

_activatingPlayer = player;

diag_log format["DEBUG WEAPONS: %1", _this];

_part_out = (_this select 3) select 0;
_part_in = (_this select 3) select 1;
_qty_out = (_this select 3) select 2;
_qty_in = (_this select 3) select 3;
_buy_o_sell = (_this select 3) select 4;
_textPartIn = (_this select 3) select 5;
_textPartOut = (_this select 3) select 6;
_traderID = (_this select 3) select 7;

_bos = 0;
_abort = false;
_msg = "";
if(_buy_o_sell == "sell") then {
_bos = 1;

_msg = "Need the weapon in your hands before you can sell it.";
_config = (configFile >> "CfgWeapons" >> _part_in);
_configName = configName(_config);

_abort = (!(_configName in (weapons player)));

if(_isToolBelt or _isBinocs) then {
_msg = "Need the item on your toolbelt before you can sell it.";
};

} else {

// buying item type must NOT exist if rifle or pistol
_msg = "Drop or sell your current weapon before you can buy a new one.";
_config = (configFile >> "CfgWeapons" >> _part_out);
_configName = configName(_config);
_wepType = getNumber(_config >> "Type");

_isPistol = (_wepType == 2);
_isRifle = (_wepType == 1);
_isToolBelt = (_wepType == 131072);
_isBinocs = (_wepType == 4096);

if (_isRifle) then {
_abort = ((primaryWeapon player) != "");
};
if (_isPistol) then {
_secondaryWeapon = "";
{
if ((getNumber (configFile >> "CfgWeapons" >> _x >> "Type")) == 2) exitWith {
_secondaryWeapon = _x;
};
} forEach (weapons player);
_abort = (_secondaryWeapon != "");
};
if(_isToolBelt or _isBinocs) then {
_abort = (_configName in (weapons player));
_msg = "Drop or sell your current toolbelt item before you can buy a new one.";
};
};

if (_abort) exitWith {
cutText [_msg, "PLAIN DOWN"];
DZE_ActionInProgress = false;
};

cutText [(localize "str_epoch_player_105"), "PLAIN DOWN"];
//player playActionNow "PutDown"; //Анимация отключена

_canAfford = false;
if(_bos == 1) then {

//sell
_qty = {_x == _part_in} count weapons player;
if (_qty >= _qty_in) then {
_part_inClass =  configFile >> "CfgWeapons" >> _part_in;
_removed = ([player,_part_inClass,_qty_in] call BIS_fnc_invRemove);
if (_removed == _qty_in) then {
_canAfford = [[[_part_out,_qty_out]],1] call epoch_returnChange;
};
};

} else {

//buy
_trade_total = [[_part_in,_qty_in]] call epoch_itemCost;
_total_currency = call epoch_totalCurrency;
_return_change = _total_currency - _trade_total;
if (_return_change >= 0) then {
_canAfford = true;
};
};

if (_canAfford) then {

//["PVDZE_obj_Trade",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
if (isNil "_part_out") then { _part_out = "Unknown Weapon/Magazine" };
if (isNil "inTraderCity") then { inTraderCity = "Unknown Trader City" };
if(_bos == 1) then {
// Selling
PVDZE_obj_Trade = [_activatingPlayer,_traderID,_bos,_part_in,inTraderCity,_part_out,_qty_out];
} else {
// Buying
PVDZE_obj_Trade = [_activatingPlayer,_traderID,_bos,_part_out,inTraderCity,_part_in,_qty_in];
};
publicVariableServer  "PVDZE_obj_Trade";

if(_bos == 0) then {

waitUntil {!isNil "dayzTradeResult"};

//diag_log format["DEBUG Complete Trade: %1", dayzTradeResult];

if(dayzTradeResult == "PASS") then {

_done = [[[_part_in,_qty_in]],0] call epoch_returnChange;
if (_done) then {
player addWeapon _part_out;
cutText [format[(localize "str_epoch_player_186"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
};

} else {
cutText [format[(localize "str_epoch_player_183"),_textPartOut] , "PLAIN DOWN"];
};
} else {
// selling
cutText [format[(localize "str_epoch_player_186"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
};

dayzTradeResult = nil;
} else {
if(_bos == 0) then {
_qty = {_x == _part_in} count magazines player;
} else {
_qty = {_x == _part_in} count weapons player;
};
_needed =  _qty_in - _qty;
cutText [format[(localize "str_epoch_player_184"),_needed,_textPartIn] , "PLAIN DOWN"];
};

DZE_ActionInProgress = false;

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

9
init.sqf
[] execVM "Scripts\chat_kick.sqf";

chat_kick.sqf
if ((getPlayerUID player) in ["11111111111111111","22222222222222222","333333333333333333"]) exitWith {}; //admins, moderators
private ["_maxSeconds", "_seconds"];
_maxSeconds = 10;
_seconds = 0;
while {true} do
{
waitUntil {(!isNull findDisplay 55) and (!isNull findDisplay 63) and (ctrlText ((findDisplay 63) displayCtrl 101) == localize "STR_CHANNEL_SIDE")};
cutText ["НЕ ГОВОРИТЕ В ОБЩИЙ КАНАЛ СВЯЗИ!", "PLAIN"];
systemChat format["При повторном разговоре в общий канал, Вы будете убиты через: %1 сек.", (_maxSeconds - _seconds)];
if (_seconds >= _maxSeconds) then
{player setDamage 1;}; 
_seconds = _seconds + 1;
sleep 1;
};

10
compiles.sqf
	player_death =				compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_death.sqf"; //найти
player_death = compile preprocessFileLineNumbers "custom\player_death.sqf"; //заменить

AH.sqf
					[] spawn (compile preprocessFileLineNumbers '\z\addons\dayz_code\compile\player_death.sqf'); //найти
[] spawn (compile preprocessFileLineNumbers 'custom\player_death.sqf'); //заменить

player_death.sqf
private ["_display","_body","_playerID","_array","_source","_method","_canHitFree","_isBandit","_punishment","_humanityHit","_myKills","_humanity","_kills","_killsV","_myGroup"];
disableSerialization;
if (deathHandled) exitWith {};
deathHandled = true;
if ((alive player) && {isNil {dayz_playerName}}) then {
dayz_playerName = name player;
};
//Prevent client freezes
_display = findDisplay 49;
if(!isNull _display) then {_display closeDisplay 0;};
if (dialog) then {closeDialog 0;};
if (visibleMap) then {openMap false;};
disableUserInput true;

_body = player;
if (alive _body) then {
_body2 = _body;
_body2 setDamage 1;
};

_body spawn {
"colorCorrections" ppEffectEnable true;"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 0.1],  [1, 1, 1, 0.0]];
"colorCorrections" ppEffectCommit 0;
"dynamicBlur" ppEffectEnable true;
"dynamicBlur" ppEffectAdjust [2];
"dynamicBlur" ppEffectCommit 0;
showCinemaBorder true;
camUseNVG false;
_dead_s = "camera" camCreate [(getPosATL _this select 0), (getPosATL _this select 1),(getPosATL _this select 2)+4];
_dead_s cameraEffect ["internal","back"];

_dead_s camSetFOV 2;
_dead_s camSetTarget (vehicle _this);
_dead_s camCommit 0;
waitUntil {camCommitted _dead_s};
sleep 3;
_dead_s camSetTarget [(getPosATL _this select 0), (getPosATL _this select 1),(getPosATL _this select 2)+800];
_dead_s camSetRelPos [0,5,0];
_dead_s camCommit 80;
};
_playerID = getPlayerUID player;
_infected = 0;

PVDZE_plr_Died = [dayz_characterID,0,_body,_playerID,_infected, dayz_playerName];
publicVariableServer "PVDZE_plr_Died";

_id = [player,20,true,getPosATL player] call player_alertZombies;

sleep 0.5;

0.1 fadeSound 0;
 
player setVariable ["NORRN_unconscious", false, true];
player setVariable ["unconsciousTime", 0, true];
player setVariable ["USEC_isCardiac",false,true];
player setVariable ["medForceUpdate",true,true];
player setVariable ["startcombattimer", 0];
r_player_unconscious = false;
r_player_cardiac = false;
if (Rangenveh > 0) then {
Rangenveh = 0;
    VEHSAFE setVariable["Rangenveh",0,true];
};

_array = _this;
if (count _array > 0) then {
_source = _array select 0;
_method = _array select 1;
if ((!isNull _source) && (_source != player)) then {
_humanity = 0;
_wait = 0.1;
_DeadBandit = false;
_KillerBandit = false;
_Deadherou = false;
_Dead_kepka = false;
_Killerherou = false;
_Killer_kepka = false;
_DeadHumanity = player getVariable["humanity",0];
if (_DeadHumanity <= -2500) then {_DeadBandit = true;};
if (_DeadHumanity >= 3000) then {_Deadherou = true;};
if ((!_DeadBandit) && (!_Deadherou)) then {_Dead_kepka = true;};

_KillerHumanity = _source getVariable["humanity",0];
if (_KillerHumanity <= -2500) then {_KillerBandit = true;};
if (_KillerHumanity >= 3000) then {_Killerherou = true;};
if ((!_KillerBandit) && (!_Killerherou)) then {_Killer_kepka = true;};

if (_DeadBandit) then
{
_kills = _source getVariable ["banditKills",0];
_source setVariable ["banditKills",(_kills + 1),true];
}
else
{
_kills = _source getVariable ["humanKills",0];
_source setVariable ["humanKills",(_kills + 1),true];
};


if (_Deadherou) then { //убили героя
// убийца герой
if (_Killerherou) then {
             _humanity = -4000;
_i = -((_DeadHumanity / 1000) * 1.6);
_humanity = round(_humanity + _i);
};

// убийца бандит
    if (_KillerBandit) then {
            _humanity = -3000;
};

// убийца кепка
    if (_Killer_kepka) then {
            _humanity = -3500;
_i = -((_DeadHumanity / 1000) * 1.6);
_humanity = round(_humanity + _i);
};

};

if (_DeadBandit) then { //убили бандита
// убийца герой
if (_Killerherou) then {
             _humanity = 400;
_i = -((_DeadHumanity / 1000) * 1.6);
_humanity = round(_humanity + _i);
};
// убийца бандит
if (_KillerBandit) then {
            _humanity = 600;
_i = -((_DeadHumanity / 1000) * 1.2);
_humanity = round(_humanity + _i);
};
// убийца кепка
if (_Killer_kepka) then {
            _humanity = 500;
_i = -((_DeadHumanity / 1000) * 1.6);
_humanity = round(_humanity + _i);
};
};

if (_Dead_kepka) then { //убили кепку
// убийца герой
if (_Killerherou) then {
             _humanity = -3000;

};
// убийца бандит
if (_KillerBandit) then {
            _humanity = -2000;

};
// убийца кепка
if (_Killer_kepka) then {
            _humanity = -2500;

};
};

PVDZE_send = [_source,"Humanity",[_source,_humanity,_wait]];
publicVariableServer "PVDZE_send";



};
_body setVariable ["deathType",_method,true];
};

terminate dayz_musicH;
terminate dayz_slowCheck;
terminate dayz_animalCheck;
terminate dayz_monitor1;
terminate dayz_medicalH;
terminate dayz_gui;

r_player_dead = true;

//Player is Dead!
3 fadeSound 0;
sleep 1;

dayz_originalPlayer enableSimulation true;

addSwitchableUnit dayz_originalPlayer;
setPlayable dayz_originalPlayer;
selectPlayer dayz_originalPlayer;

//deleteGroup _myGroup;
1 cutRsc ["default", "PLAIN",3];
2 cutRsc ["default", "PLAIN",3];
3 cutRsc ["default", "PLAIN",3];
4 cutRsc ["default", "PLAIN",3];

_body setVariable["combattimeout", 0, true];

//["dayzFlies",player] call broadcastRpcCallAll;
sleep 2;

//1 cutRsc ["DeathScr","BLACK OUT",3];

playMusic "dayz_track_death_1";

"colorCorrections" ppEffectEnable true;"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 0.1],  [1, 1, 1, 0.0]];
"colorCorrections" ppEffectCommit 0;
"dynamicBlur" ppEffectEnable true;
"dynamicBlur" ppEffectAdjust [2];
"dynamicBlur" ppEffectCommit 0; "colorCorrections" ppEffectEnable true;"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 0.1],  [1, 1, 1, 0.0]];
"colorCorrections" ppEffectCommit 0;
"dynamicBlur" ppEffectEnable true;
"dynamicBlur" ppEffectAdjust [2];
"dynamicBlur" ppEffectCommit 0;
_listsT = [
"Name Server" //Текст внизу экрана
];
_memberFunction = _listsT call BIS_fnc_selectRandom;

_finalText = format ["<t color='#999999'  size='0.9' align='center'>%1</t>", _memberFunction];
[_finalText, 0,(safezoneY + safezoneH * 0.75), 20, 0, 0, 31] spawn BIS_fnc_dynamicText;

_finalText2 ="<t size='2.2' color='#FF0000'>Вы мертвы</t>"; //Текст в центре экрана
[_finalText2,0,(safezoneY + safezoneH * 0.43),5,1,0,32] spawn BIS_fnc_dynamicText;

_finalText3 = "<t size='1.5' font='TahomaB' color='#FFFFFF'>vk.com/groupname</t>"; //Текст сверху экрана
[_finalText3,0,(safezoneY + safezoneH * 0.05),300,1,0,33] spawn BIS_fnc_dynamicText;

for  "_x" from 16 to 1 step -1 do {
_finalText4 = format["<t size='0.8' color='#FFFFFF'>Выход через %1 сек.</t>",_x];
[_finalText4,0,(safezoneY + safezoneH * 0.9),3,0,0,34] spawn BIS_fnc_dynamicText;
sleep 1;
};

PVDZE_Server_Simulation = [_body, false];
publicVariableServer "PVDZE_Server_Simulation";

endMission "END1";

Страницы: [1] 2