Advertisement
Guest User

Untitled

a guest
Aug 4th, 2015
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.85 KB | None | 0 0
  1. /*
  2. Rob banks Modest
  3.  
  4. */
  5. private["_unit","_unittext","_bank","_funds","_timer","_toFar","_pos","_marker","_markerText","_chance","_tazed","_player","_vault"];
  6. _bank = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param;
  7. _unit = [_this,1,ObjNull,[ObjNull]] call BIS_fnc_param;
  8. _unittext = [_this,1,ObjNull,[ObjNull]] call BIS_fnc_param;
  9. _action = [_this,2] call BIS_fnc_param;//Action name
  10. _player = player;
  11. _toFar = false;
  12. _tazed = false;
  13. _timer = time + (1 * 60);
  14. _pos = GetPos player;
  15. _vault = (nearestObjects[getPosATL player,["Vault_Door"],100]) select 0;
  16. if(player distance _bank > 15) exitWith {
  17. hint "You need to stand inside the bank to rob it!"
  18. };
  19. if (playerSide == west) exitWith {hint "Really, A police officer is trying to rob a bank.. Haha you got me officer, what can I do for you?"};
  20. if (currentWeapon _player == "") exitWith {hint "This bank is not about to get robbed by a unarmed sheila, I am notifying the police"}; //This will check if the player has a weapon on him
  21. if({side _x == west} count playableUnits < 0) exitWith {hint "There needs to be 5 police officers on duty to rob a bank"};
  22.  
  23.  
  24.  
  25. _bank switchMove "AmovPercMstpSsurWnonDnon";//Making a shop owner surrender
  26. _bank removeAction _action;//Deleting the action,so it won't be spammed
  27. life_robbery_in_progress = true;
  28. ["Wow don't shoot, I have kids and a family! The Vault is upstairs and its locked, Erm hold on... ",10,"red"] call A3L_Fnc_Msg;
  29. sleep 5;
  30. ["I have activated the vault door to open, this will take 10 minutes due to our security system.",10,"red"] call A3L_Fnc_Msg;
  31. //sleep 3;
  32. //titleText["A Civilian spotted you and dialled 999 - Police are on their way.","PLAIN"];
  33.  
  34. [[3,format ["Australia's Breaking News %1 Commonwealth bank is currently being robbed. Armed Police units are surrounding the scene, it is unclear if there are any hostages. Passers by are warned to stay clear of the area"]],"life_fnc_broadcast",true,false] call life_fnc_MP;
  35. if (side player == west) then {
  36. titleText ["Silent alarm hit in a commonwealth bank, check location for details!", "PLAIN"];
  37. ["The bank is getting robbed!",30,"blue"] call A3L_Fnc_Msg;
  38. };
  39. [[getPlayerUID _player,name _player,"211g"],"life_fnc_wantedAdd",false,false] spawn life_fnc_MP;
  40.  
  41. _marker = createMarker ["_unit", _Pos];
  42. "_unit" setMarkerColor "ColorBlue";
  43. "_unit" setMarkerShape "ELLIPSE";
  44. "_unit" setMarkerType "Empty";
  45. "_unit" setMarkerSize [50, 50];
  46. _markerText = createMarker ["_unittext", _Pos];
  47. "_unittext" setMarkerColor "ColorBlack";
  48. "_unittext" setMarkerText "Warning! Robbery in progress";
  49. "_unittext" setMarkerType "mil_warning";
  50.  
  51. while {true} do
  52. {
  53. //Timer display (TO BE REPLACED WITH A NICE GUI LAYER)
  54. _countDown = [(_timer - time),"MM:SS.MS"] call BIS_fnc_secondsToString;
  55. hintSilent format["You need to stay within 5m!\n\nTime Remaining:\n %1\n\nDistance: %2m",_countDown,round(player distance _bank)];
  56.  
  57. if(player distance _bank > 15) exitWith {_toFar = true;};
  58. if((round(_timer - time)) < 1) exitWith {};
  59. if(!alive player) exitWith {};
  60. if(life_istazed) exitWith {_tazed = true;};
  61. sleep 0.1;
  62. };
  63.  
  64. switch(true) do
  65. {
  66. case (_toFar):
  67. {
  68. hint "You left the area - The bank robbery has ended, The police are onto you!";
  69. [[2,"Robbery Failed. Suspect is fleeing the crime scene!"],"life_fnc_broadcast",west,false] spawn life_fnc_MP;
  70. [[3,format ["Australia's Breaking News %1 Commonwealth bank update - The bank robbers have fleed the scene. Police are thought to be on the trail. There are no reports of any injurys"]],"life_fnc_broadcast",true,false] call life_fnc_MP;
  71. [[_bank,0],"TON_fnc_robGasState",false,false] spawn life_fnc_MP;
  72. [[getPlayerUID _player,name _player,"211g"],"life_fnc_wantedAdd",false,false] spawn life_fnc_MP;
  73. sleep 30;
  74. deleteMarker "_unit";
  75. deleteMarker "_unittext";
  76. };
  77. case (!alive player):
  78. {
  79. hint "Failed robbery, Suspect down.";
  80. [[2,"Robbery stopped, suspect was brutally murdered!"],"life_fnc_broadcast",west,false] spawn life_fnc_MP;
  81. [[3,format ["Australia's Breaking News %1 Commonwealth bank update - Shots fired! Armed police forced to open fire on the suspect. Early reports indicate the robber has died"]],"life_fnc_broadcast",true,false] call life_fnc_MP;
  82. [[_bank,0],"TON_fnc_robGasState",false,false] spawn life_fnc_MP;
  83. sleep 30;
  84. deleteMarker "_unit";
  85. deleteMarker "_unittext";
  86. };
  87.  
  88. case (_tazed):
  89. {
  90. hint "You were tazed, the robbery has failed!";
  91. [[2,"Robbery stopped, arrest the robber and collect the bounty!"],"life_fnc_broadcast",west,false] spawn life_fnc_MP;
  92. [[3,format ["Australia's Breaking News %1 Commonwealth bank update - Armed police have the suspect down using non lethal force and in custody"]],"life_fnc_broadcast",true,false] call life_fnc_MP;
  93. [[_bank,0],"TON_fnc_robGasState",false,false] spawn life_fnc_MP;
  94. [[getPlayerUID _player,name _player,"211c"],"life_fnc_wantedAdd",false,false] spawn life_fnc_MP;
  95. sleep 30;
  96. deleteMarker "_unit";
  97. deleteMarker "_unittext";
  98. };
  99.  
  100. case ((round(_timer - time)) < 5):
  101. {
  102. [[2,"!!!"],"life_fnc_broadcast",west,false] spawn life_fnc_MP;
  103. [[0,"Be Careful Robbers might still be at the crime scene."],"life_fnc_broadcast",west,false] spawn life_fnc_MP;
  104. [[getPlayerUID _player,name _player,"211c"],"life_fnc_wantedAdd",false,false] spawn life_fnc_MP;
  105. _vault animate ["Vault_Door", 1];
  106. deleteMarker "_unit";
  107. deleteMarker "_unittext";
  108. _vault animate ["Vault_Door", 1];
  109. [[_bank,1],"TON_fnc_robGasState",false,false] spawn life_fnc_MP;
  110. sleep 1800;//Cooldown between the robberies
  111. };
  112. };
  113.  
  114. life_robbery_in_progress = false;
  115. _bank switchMove "";//Reseting the shop owner
  116.  
  117. _action = _bank addAction["Start Bank Roberry",life_fnc_mgbank];//Adding action for the robbery
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement