Advertisement
Guest User

Untitled

a guest
Jan 25th, 2015
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.85 KB | None | 0 0
  1. /*
  2. Author: H4SHK3KS
  3. File: fn_robFuelStation.sqf
  4. Description: enables the robbing of fuel stations
  5. */
  6.  
  7.  
  8. private["_robber","_shop","_amount","_action","_rip","_chance","_progress","_progressText","_progressValue"];
  9.  
  10. _shop = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param;
  11. _robber = [_this,1,ObjNull,[ObjNull]] call BIS_fnc_param;
  12. _action = [_this,2] call BIS_fnc_param;
  13.  
  14.  
  15. _amount = 25000 + round(random 35000);
  16.  
  17. _rip = false;
  18.  
  19. if (_robber distance _shop > 6) exitWith {hint "Du bist zu weit weg um auszurauben!"};
  20. if (_rip) exitWith {hint "Diese Tankstelle wird bereits ausgeraubt!"};
  21. if (!(alive player)) exitWith {};
  22. if (vehicle player != player) exitWith { hint "Steige aus deinem Fahrzeug aus!"};
  23. if (currentWeapon _robber == "") exitWith {hint "Du hast keine Waffe!"}
  24. if (west countSide playableUnits < 5) exitWith {hint "Es sind nicht genug Polizisten anwesend!"}
  25.  
  26. _rip = true;
  27.  
  28. _shop removeAction _action;
  29.  
  30.  
  31. _chance = random(100);
  32. if(_chance > 50) then { [[1,"Eine Tankstelle wird ausgeraubt"],"life_fnc_broadcast",west,false] spawn life_fnc_MP; };
  33.  
  34.  
  35. disableSerialization;
  36.  
  37. 5 cutRsc ["life_progress", "PLAIN"];
  38. _ui = uiNamespace getVariable "life_progress";
  39.  
  40. _progress = _ui displayCtrl 38201;
  41. _progressText = _ui displayCtrl 38202;
  42. _progressText ctrlSetText format["Raub in Arbeit, bleib in der Nähe (1%1)","%"]
  43. _progress progressSetPosition 0.01;
  44.  
  45. _progressValue = 0.001;
  46.  
  47. if(_rip) then {
  48. _markerName = "Rob" + str(name player);
  49. _pos = position player;
  50. _marker createMarker[_markerName, _pos]
  51. _markerName setMarkerColor "ColorRed";
  52. _markerName setMarkerText "Tankstellenraub";
  53. _markerName setMarkerType "mil_warning";
  54. _markerName setmarkerSize [5,5];
  55.  
  56.  
  57.  
  58. while {_progressValue < 1} then {
  59. sleep 4;
  60. _progressValue = _progressValue + 0.01;
  61. _progress progressSetPosition _progressValue;
  62. _progressText ctrlSetText format["Raub in Arbeit, bleib in der Nähe (%1%2)",round(_progressValue * 100),"%"];
  63.  
  64.  
  65. if (_robber distance _shop > 10 || !(alive player)) exitWith {
  66.  
  67. _rip = false;
  68. deleteMarker _markerName;
  69. hint "Du musst 10 m im Umkreis sein um auszurauben!"
  70. if(_chance > 50) then {[[1,"Der Tankstellenraub wurde abgebrochen!"],"life_fnc_broadcast",west,false] spawn life_fnc_MP;};
  71. sleep 600;
  72. _action = _shop addAction["Tankstelle ausrauben",life_fnc_robFuelStation];
  73.  
  74. };
  75. };
  76. };
  77.  
  78. 5 cutText ["","PLAIN"];
  79.  
  80. titleText[format ["Du hast %1 $ gestohlen, hau ab, bevor die Polizei dich erwischt!",_amount],"PLAIN"];
  81.  
  82. life_cash = life_cash + _amount;
  83.  
  84. _rip = false;
  85.  
  86. life_use_atm = false;
  87. sleep 600;
  88. life_use_atm = true;
  89. if (_chance > 50) then {
  90. [[getPlayerUID _robber,_robber getVariable["realname",name _robber],"211"],"life_fnc_wantedAdd",false,false] spawn life_fnc_MP;
  91. };
  92.  
  93. deleteMarker _markerName;
  94.  
  95. _action = _shop addAction["Tankstelle ausrauben",life_fnc_robFuelStation];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement