Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "..\..\script_macros.hpp"
- private["_time","_count","_building","_door","_cpRate","_title","_progressBar","_titleText","_cp","_ui","_pos","_marker","_insz","_uid","_ownerRet","_progress_rscLayer","_error","_isFed","_time","_count"];
- _count = "cop" call life_fnc_countRole;
- if(_count < 5)exitWith{hint"Для взлома системы безопасности необходимо присутствие 5 полицейских";};
- _time = _count * 60;
- life_interrupted = false;
- if(player call life_fnc_getRole != "civ")exitWith{};
- if(player GVAR ["isArrested",false])exitWith{};
- _building = nearestObject [player, "Land_MainSection"];
- _block = nearestObject [player, "Land_PowerGenerator_F"];
- if(isNull _building OR !(_building isKindOf "Land_MainSection")) exitWith {};
- if(isNull _block OR !(_block isKindOf "Land_PowerGenerator_F")) exitWith {};
- if(_block GVAR ["inProcess",false])exitWith {hint"Уже кем то используется"};
- if((life_istazed) or (life_isknocked) or !(alive player) or (player GVAR ["restrained",false]))exitWith {}; //Tazed
- _lastTime = _building GVAR ["time",0];
- if(_lastTime != 0 && {(time - _lastTime) < (30*60)})exitWith{hint"С момента последнего взлома не прошло 60 минут, это опасно"};
- [[1,2],"STR_ISTR_Bolt_AlertPrison",true,[]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
- //поехали? ..... в западло выделять в отдельный файл может потом как-нибудь наведу порядок.
- [_building,_block,_time]spawn{
- private["_time","_building","_door","_cpRate","_title","_progressBar","_titleText","_cp","_ui","_pos","_marker","_insz","_uid","_ownerRet","_progress_rscLayer","_error","_isFed","_prisonDoors1","_prisonDoors2"];
- _building = param [0,ObjNull,[ObjNull]];
- _block = param [1,ObjNull,[ObjNull]];
- _time = param [2,120,[120]];
- _error = false;
- life_action_inUse = true;
- _prisonDoors1 = ["Door1","Door2","Door3","Door4","Door5","Door6","Door7","Door8","Door9","Door10","Door11","Door12","Door13","Door14","S1","S2","S3","S4","S5","S6","S7"];// 1- открыть; 0 - закрыть
- _prisonDoors2 = ["A1","A2","A3","A4","A5","A6","A7","A8","A9","A10","A11","A12","B1","B2","B3","B4","B5","B6","B7","B8","B9","B10","B11","B12","C1","C2","C3","C4","C5","C6","C7","C8","C9","C10","C11","C12","D1","D2","D3","D4","D5","D6","D7","D8","D9","D10","D11","D12"];// -1- открыть; 0 - закрыть
- _block SVAR ["inProcess",true,true];
- disableSerialization;
- _time = gen_timer_prisonSecurity;
- if (call life_donator) then {_time = _time * 0.5};
- _startTime = time;
- _endTime = _startTime + _time;
- _error = false;
- _check = {
- if(_this)then{
- !alive player OR !(NOTINVEH(player)) OR player GVAR ["tazed",false] OR life_interrupted OR player getVariable["restrained",false] OR LSINCAP(player)
- }else{
- !alive player OR !(NOTINVEH(player)) OR player GVAR ["tazed",false] OR player getVariable["restrained",false] OR LSINCAP(player)
- };
- };
- waitUntil{
- _progress = floor linearConversion[ _startTime, _endTime, time, 0, 24 ];
- [_progress] call life_fnc_progressBar;
- if !(ISANIMSTATE("ainvpknlmstpsnonwnondnon_medic_1")) then {
- [player,"ainvpknlmstpsnonwnondnon_medic_1"] remoteExecCall ["life_fnc_animSync",0];
- };
- if(true call _check) exitWith {_error = true;true};
- if(time > _endTime) exitWith {true};
- uiSleep 1;
- };
- player playActionNow "stop";
- ("life_progress" call BIS_fnc_rscLayer) cutText ["","PLAIN"];
- life_action_inUse = false;
- if (LSINCAP(player)) exitWith {[player] call life_fnc_setDeadState};
- if(_error) exitWith {systemChat "Действие прервано."};
- if(random(100) < 80) then {
- titleText["Вы взломали ситему безопасности тюрьмы, все двери открыты","PLAIN"];
- {
- _building animate [format["%1",_X],1];
- }foreach _prisonDoors1;
- {
- _building animate [format["%1",_X],-1];
- }foreach _prisonDoors2;
- _building SVAR ["time",time,true];
- [_time] remoteExecCall ["life_fnc_GoBabyGo",RCLIENT];
- sleep _time;
- {
- _building animate [format["%1",_X],0];
- }foreach _prisonDoors1;
- {
- _building animate [format["%1",_X],0];
- }foreach _prisonDoors2;
- }else{
- titleText["Вам не удалось взломать ситему безопасности тюрьмы...","PLAIN"];
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement