Advertisement
Guest User

Untitled

a guest
Aug 15th, 2023
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.47 KB | None | 0 0
  1. private["_robber","_shop","_kassa","_ui","_progress","_pgText","_cP","_pos"];
  2. _shop = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param;
  3. _robber = [_this,1,ObjNull,[ObjNull]] call BIS_fnc_param;
  4. _kassa = 1000;
  5. _action = [_this,2] call BIS_fnc_param;
  6.  
  7. if(life_fuelstation_rob) exitWith {};
  8. if(side _robber != civilian) exitWith {hintSilent "You can't rob this gas station now"};
  9. if(_robber distance _shop > 5) exitWith {hintSilent "You have to stay 5m near the cashier"};
  10. if (vehicle player != _robber) exitWith {hintSilent "Get out of your vehicle"};
  11. if !(alive _robber) exitWith {};
  12. if (currentWeapon _robber == "") exitWith {hintSilent "Haha, what are you threatening me with? You don't even have a water pistol?"};
  13. if (currentWeapon player in ["","Binocular","Rangefinder"] ) exitWith {hintSilent "You don't scare me with that thing";};
  14. if (_kassa isEqualTo 0) exitWith {hintSilent "There is currently no money in the register"};
  15. if (_shop getVariable ["fuelstation_rob",false]) exitWith {hintSilent "The gas station is already being robbed!";};
  16.  
  17. _kassa = 10000 + round(random 10000);
  18. _shop removeAction _action;
  19. _shop switchMove "AmovPercMstpSsurWnonDnon";
  20. _chance = random(100);
  21.  
  22. _cops = (west countSide playableUnits);
  23.  
  24. if(_cops < 5) exitWith{hintSilent "There aren't enough cops online to rob a gas station";};
  25.  
  26. if(_chance >= 1) then {[1,format["!!!ALARM!!! Der Kassierer der Tankstelle: %1 wird gerade ausgeraubt", _shop]] remoteExec ["life_fnc_broadcast",west]; };
  27.  
  28. disableSerialization;
  29. 5 cutRsc ["life_progress","PLAIN"];
  30. _ui = uiNameSpace getVariable "life_progress";
  31. _progress = _ui displayCtrl 38201;
  32. _pgText = _ui displayCtrl 38202;
  33. _pgText ctrlSetText format["Gas station robbery in progress, stay around (10m) (1%1)...","%"];
  34. _progress progressSetPosition 0.01;
  35. _cP = 0.01;
  36.  
  37. life_fuelstation_rob = true;
  38. _shop setVariable ["fuelstation_rob",true,true];
  39.  
  40. while{true} do
  41. {
  42. uiSleep 5.00;
  43. _cP = _cP + 0.01;
  44. _progress progressSetPosition _cP;
  45. _pgText ctrlSetText format["Gas station robbery in progress, stay around (10m) (%1%2)...",round(_cP * 100),"%"];
  46. _Pos = position player;
  47. _marker = createMarker ["Marker200", _Pos];
  48. "Marker200" setMarkerColor "ColorRed";
  49. "Marker200" setMarkerText "!!!Achtung Tankstellenraub!!!";
  50. "Marker200" setMarkerType "mil_warning";
  51. if(_cP >= 1) exitWith {};
  52. if(_robber distance _shop > 10.5) exitWith { };
  53. if!(alive _robber) exitWith {};
  54. if (currentWeapon _robber == "") exitWith {};
  55. };
  56. if (currentWeapon _robber == "") exitWith {deleteMarker "Marker200"; _shop switchMove ""; hintSilent "Du hast keine Waffe mehr mit was willst du mich nun bedrohen?"; 5 cutText ["","PLAIN"]; life_fuelstation_rob = false;};
  57. if!(alive _robber) exitWith {life_fuelstation_rob = false;};
  58. if(_robber distance _shop > 10.5) exitWith { deleteMarker "Marker200"; _shop switchMove ""; hintSilent "Du hast dich zu weit vom Kassierer entfernt, die Kasse ist nun verschlossen"; 5 cutText ["","PLAIN"]; life_fuelstation_rob = false; };
  59. 5 cutText ["","PLAIN"];
  60. titleText[format["Du hast %1 Euro gestohlen, die Cops sind bereits auf dem Weg verschwinde nun",[_kassa] call life_fnc_numberText],"PLAIN"];
  61. deleteMarker "Marker200";
  62. life_cash = life_cash + _kassa;
  63. life_use_atm = false;
  64. life_fuelstation_rob = false;
  65. _shop setVariable ["fuelstation_rob",false,true];
  66. uiSleep (30 + random(180));
  67. life_use_atm = true;
  68.  
  69. uiSleep 300;
  70. _action = _shop addAction["Tankstelle ausrauben",life_fnc_robShops];
  71. _shop switchMove "";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement