Новости

SMF - Just Installed!

[Инструкция] Дополненный стандартный отдых

ReloadeD · 1592

ReloadeD

  • Administrator
  • Новенький
  • *****
    • Сообщений: 17
    • Рейтинг: 15
    • Просмотр профиля
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"];
};
};
« Последнее редактирование: Февраля 09, 2016, 08:31:33 pm от ReloadeD »