Новости

SMF - Just Installed!

[Скрипт] Наполнение бочек нефтью

ReloadeD · 1746

ReloadeD

  • Administrator
  • Новенький
  • *****
    • Сообщений: 17
    • Рейтинг: 15
    • Просмотр профиля
: Февраля 10, 2016, 12:54:48 am
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"
« Последнее редактирование: Февраля 11, 2016, 02:12:04 pm от ReloadeD »



ReloadeD

  • Administrator
  • Новенький
  • *****
    • Сообщений: 17
    • Рейтинг: 15
    • Просмотр профиля
Ответ #1 : Февраля 10, 2016, 10:12:38 pm
fn_selfActions.sqf
private["_isBarrelsPalet"]; // добавить
// вставить ниже строки _isAlive = alive _cursorTarget;
_isBarrelsPalet = _typeOfCursorTarget in ["MAP_Barels3"];
	// Barrels Palet
if (_isBarrelsPalet) then {
if (s_player_palet < 0) then {
s_player_palet = player addAction ["Разобрать поддон с бочками", "custom\barrelspalet.sqf",cursorTarget, 0, false, true, "",""];
};
} else {
player removeAction s_player_palet;
s_player_palet = -1;
};
	player removeAction s_player_flipveh; // найти
s_player_flipveh = -1; // найти
player removeAction s_player_palet; // добавить
s_player_palet = -1; // добавить

variables.sqf
	s_player_flipveh = -1; // найти
s_player_palet = -1; // добавить

barrelspalet.sqf
private ["_paletEmpty","_palet","_holder","_paletBarrels","_random","_object","_mine","_colorWire","_msgBlow","_dir","_pos","_crowBar","_knife","_itemKnife","_isMineBarrel","_isSafeBarrel","_bomb"];

_random = random 10;
_object = _this select 3;
_mine = ["1Rnd_HE_M203","1Rnd_HE_GP25","HandGrenade_west","HandGrenade_east","PipeBomb","BAF_ied_v1","BAF_ied_v2","BAF_ied_v3","BAF_ied_v4"] call BIS_fnc_selectRandom;
_colorWire = ["красный","синий"] call BIS_fnc_selectRandom;
_msgBlow = ["Надо было резать другой провод...","Не повезло...","Вот дерьмо...","Мне конец!","И за каким мне эти бочки?","Сейчас рванет!"] call BIS_fnc_selectRandom;
_paletEmpty = "MAP_paletaA";
_paletBarrels = "MAP_Barels3";
_dir = getDir _object;
_pos = getPosATL _object;
_crowBar = "ItemCrowbar" in items player;
_itemKnife = "ItemKnife" in items player;
_isMineBarrel = _object getVariable ["isMinedBarrel",false];
_isSafeBarrel = _object getVariable ["isSafeBarrel",false];

if (DZE_ActionInProgress) exitWith { cutText [format["Уже разбирается..."],"PLAIN DOWN"];};

if (!_crowBar) exitWith {cutText [format["Чтобы разобрать это нужен Ломик"],"PLAIN DOWN"];};

if (!_isSafeBarrel) then {
if (!_isMineBarrel) then {
DZE_ActionInProgress = true;
player playActionNow "Medic";
_dis=50;
_sfx = "repair";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak; 
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
sleep 6;
if (_random > 4) then {
DZE_ActionInProgress = false;
cutText ["Вы разобрали поддон с бочками.","PLAIN DOWN"];
deleteVehicle _object;
_palet = createVehicle [_paletEmpty,_pos,[],0,"CAN_COLLIDE"];
_palet setDir _dir;
_holder = createVehicle ["WeaponHolder",_pos,[],0,"CAN_COLLIDE"];
_holder addMagazineCargoGlobal ["ItemFuelBarrelEmpty",4];
player reveal _holder;
player action ["Gear", _holder];
} else {
DZE_ActionInProgress = false;
_object setVariable ["isMinedBarrel",true,true];
cutText ["Бочки заминированы! \n У вас есть одна попытка чтобы разминировать их.","PLAIN DOWN"];
};
} else {
if (!_itemKnife) then {
_knife = (gettext (configFile >> 'cfgweapons' >> _itemKnife >> 'displayName'));
cutText [format["Чnобы обезвредить растяжку требуется %1...",_knife],"PLAIN DOWN"];
} else {
DZE_ActionInProgress = true;
cutText [format["Какой провод резать? \n Красный или синий? \n Попробую %1...",_colorWire],"PLAIN DOWN"];
player playActionNow "Medic";
_dis=50;
_sfx = "repair";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak; 
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
sleep 5;
if (_random > 3) then {
sleep 1;
DZE_ActionInProgress = false;
cutText ["Растяжка обезврежена!","PLAIN DOWN"];
player addMagazine _mine;
_object setVariable ["isMinedBarrel",false,false];
_object setVariable ["isSafeBarrel",true,true];
} else {
sleep 1;
DZE_ActionInProgress = false;
cutText [format["%1",_msgBlow],"PLAIN DOWN"];
sleep 1;
cutText ["5","PLAIN DOWN"];
sleep 1;
cutText ["4","PLAIN DOWN"];
sleep 1;
cutText ["3","PLAIN DOWN"];
sleep 1;
cutText ["2","PLAIN DOWN"];
sleep 1;
cutText ["1","PLAIN DOWN"];
sleep 1;
_bomb = createVehicle ["Bo_GBU12_LGB",_pos,[],0, "NONE"];
_bomb setDamage 1;
_object setVariable ["isMinedBarrel",false,false];
_object setVariable ["isSafeBarrel",false,false];
    deleteVehicle _object;
};
};
};
} else {
DZE_ActionInProgress = true;
player playActionNow "Medic";
_dis=50;
_sfx = "repair";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak; 
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
sleep 6;
DZE_ActionInProgress = false;
cutText ["Вы разобрали поддон с бочками.","PLAIN DOWN"];
deleteVehicle _object;
_palet = createVehicle [_paletEmpty,_pos,[],0,"CAN_COLLIDE"];
_palet setDir _dir;
_holder = createVehicle ["WeaponHolder",_pos,[],0,"CAN_COLLIDE"];
_holder addMagazineCargoGlobal ["ItemFuelBarrelEmpty",4];
player reveal _holder;
player action ["Gear", _holder];
};

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

setvariable.txt
//добавить во вторую строку, должно выглядеть так
5 "\+" !="isMinedBarrel" !="isSafeBarrel"
« Последнее редактирование: Февраля 16, 2016, 02:08:39 am от ReloadeD »