Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.69 KB | None | 0 0
  1. #include "..\..\script_macros.hpp"
  2. /*
  3. File: fn_uwsl.sqf
  4. Author: Unknown
  5. Adapted by: Apocalyptos
  6.  
  7. Description:
  8. Marine mine to allow the opening of the inventory of ship wrecks.
  9. */
  10.  
  11. private["_bomb","_uiDisp","_time","_timer","_wreck"];
  12.  
  13. //Check
  14. if (life_shipwreck_bomb) exitWith {};
  15. if (playerSide != civilian) exitWith {hint localize "STR_Dialog_NotCivil"};
  16. _wreck = nearestObjects [player, ["Land_Wreck_Traw_F","Land_Wreck_Traw2_F"], 20];
  17. if (count _wreck isEqualTo 0) exitWith {hint localize "STR_Dialog_WreckOnly"};
  18. _wreck = _wreck select 0;
  19.  
  20. if (!isNull _wreck) then {
  21. if (_wreck getVariable["opened", false]) then {
  22. hint localize "STR_Dialog_AlreadyOpen";
  23. life_shipwreck_bomb = false;
  24. } else {
  25. disableSerialization;
  26. "lifeTimer" cutRsc ["life_timer","PLAIN"];
  27. _uiDisp = uiNamespace getVariable "life_timer";
  28. _timer = _uiDisp displayCtrl 38301;
  29. _time = time + (1 * 60);
  30. life_shipwreck_bomb = true;
  31. playSound3D ["A3\Sounds_F\sfx\alarm_independent.wss", _wreck];
  32.  
  33. if(!([false,"uwsl",1] call life_fnc_handleInv)) exitWith {};
  34.  
  35. for "_i" from 0 to 1 step 0 do {
  36. if (isNull _uiDisp) then {
  37. "lifeTimer" cutRsc ["life_timer","PLAIN"];
  38. _uiDisp = uiNamespace getVariable "life_timer";
  39. _timer = _uiDisp displayCtrl 38301;
  40. };
  41. if (round(_time - time) < 1) exitWith {};
  42. _timer ctrlSetText format ["%1",[(_time - time),"MM:SS.MS"] call BIS_fnc_secondsToString];
  43. sleep 0.08;
  44. };
  45. "lifeTimer" cutText["","PLAIN"];
  46. sleep 0.9;
  47.  
  48. _bomb = "Bo_GBU12_LGB_MI10" createVehicle [getPosATL _wreck select 0, getPosATL _wreck select 1, (getPosATL _wreck select 2)+2];
  49.  
  50.  
  51. switch true do {
  52. case (player distance(getMarkerPos "shipZone1") < 300): {shipwreckopen_1 = true; publicVariableServer "shipwreckopen_1";};
  53. case (player distance(getMarkerPos "shipZone2") < 300): {shipwreckopen_2 = true; publicVariableServer "shipwreckopen_2";};
  54. case (player distance(getMarkerPos "shipZone3") < 300): {shipwreckopen_3 = true; publicVariableServer "shipwreckopen_3";};
  55. case (player distance(getMarkerPos "shipZone4") < 300): {shipwreckopen_4 = true; publicVariableServer "shipwreckopen_4";};
  56. case (player distance(getMarkerPos "shipZone5") < 300): {shipwreckopen_5 = true; publicVariableServer "shipwreckopen_5";};
  57. case (player distance(getMarkerPos "shipZone6") < 300): {shipwreckopen_6 = true; publicVariableServer "shipwreckopen_6";};
  58. case (player distance(getMarkerPos "shipZone7") < 300): {shipwreckopen_7 = true; publicVariableServer "shipwreckopen_7";};
  59. case (player distance(getMarkerPos "shipZone8") < 300): {shipwreckopen_8 = true; publicVariableServer "shipwreckopen_8";};
  60. };
  61. life_shipwreck_bomb = false;
  62. };
  63. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement