Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "..\..\script_macros.hpp"
- /*
- File: fn_uwsl.sqf
- Author: Unknown
- Adapted by: Apocalyptos
- Description:
- Marine mine to allow the opening of the inventory of ship wrecks.
- */
- private["_bomb","_uiDisp","_time","_timer","_wreck"];
- //Check
- if (life_shipwreck_bomb) exitWith {};
- if (playerSide != civilian) exitWith {hint localize "STR_Dialog_NotCivil"};
- _wreck = nearestObjects [player, ["Land_Wreck_Traw_F","Land_Wreck_Traw2_F"], 20];
- if (count _wreck isEqualTo 0) exitWith {hint localize "STR_Dialog_WreckOnly"};
- _wreck = _wreck select 0;
- if (!isNull _wreck) then {
- if (_wreck getVariable["opened", false]) then {
- hint localize "STR_Dialog_AlreadyOpen";
- life_shipwreck_bomb = false;
- } else {
- disableSerialization;
- "lifeTimer" cutRsc ["life_timer","PLAIN"];
- _uiDisp = uiNamespace getVariable "life_timer";
- _timer = _uiDisp displayCtrl 38301;
- _time = time + (1 * 60);
- life_shipwreck_bomb = true;
- playSound3D ["A3\Sounds_F\sfx\alarm_independent.wss", _wreck];
- if(!([false,"uwsl",1] call life_fnc_handleInv)) exitWith {};
- for "_i" from 0 to 1 step 0 do {
- if (isNull _uiDisp) then {
- "lifeTimer" cutRsc ["life_timer","PLAIN"];
- _uiDisp = uiNamespace getVariable "life_timer";
- _timer = _uiDisp displayCtrl 38301;
- };
- if (round(_time - time) < 1) exitWith {};
- _timer ctrlSetText format ["%1",[(_time - time),"MM:SS.MS"] call BIS_fnc_secondsToString];
- sleep 0.08;
- };
- "lifeTimer" cutText["","PLAIN"];
- sleep 0.9;
- _bomb = "Bo_GBU12_LGB_MI10" createVehicle [getPosATL _wreck select 0, getPosATL _wreck select 1, (getPosATL _wreck select 2)+2];
- switch true do {
- case (player distance(getMarkerPos "shipZone1") < 300): {shipwreckopen_1 = true; publicVariableServer "shipwreckopen_1";};
- case (player distance(getMarkerPos "shipZone2") < 300): {shipwreckopen_2 = true; publicVariableServer "shipwreckopen_2";};
- case (player distance(getMarkerPos "shipZone3") < 300): {shipwreckopen_3 = true; publicVariableServer "shipwreckopen_3";};
- case (player distance(getMarkerPos "shipZone4") < 300): {shipwreckopen_4 = true; publicVariableServer "shipwreckopen_4";};
- case (player distance(getMarkerPos "shipZone5") < 300): {shipwreckopen_5 = true; publicVariableServer "shipwreckopen_5";};
- case (player distance(getMarkerPos "shipZone6") < 300): {shipwreckopen_6 = true; publicVariableServer "shipwreckopen_6";};
- case (player distance(getMarkerPos "shipZone7") < 300): {shipwreckopen_7 = true; publicVariableServer "shipwreckopen_7";};
- case (player distance(getMarkerPos "shipZone8") < 300): {shipwreckopen_8 = true; publicVariableServer "shipwreckopen_8";};
- };
- life_shipwreck_bomb = false;
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement