Advertisement
Guest User

Untitled

a guest
Mar 14th, 2019
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 3.97 KB | None | 0 0
  1. private["_robber", "_shop", "_kassa", "_ui", "_progress", "_pgText", "_cP", "_rip", "_pos"];
  2. _shop = [_this, 0, ObjNull, [ObjNull]] call BIS_fnc_param;
  3. _robber = [_this, 1, ObjNull, [ObjNull]] call BIS_fnc_param;
  4. _action = [_this, 2] call BIS_fnc_param; //Action name
  5. _kassa = 100;
  6. _rip = false;
  7. if (side _robber != civilian) exitWith {
  8.     ["Aktion abgebrochen","Du bist im Dienst und kannst die Stadtbank nicht ausrauben!", true, "fast"] spawn ESG_fnc_notify;
  9. };
  10. if (_robber distance _shop > 35) exitWith {
  11.     ["Aktion abgebrochen","Du musst in einen Radius von 35m bleiben!", true, "fast"] spawn ESG_fnc_notify;
  12. };
  13. if (_rip) exitWith {
  14.     ["Aktion abgebrochen","Es ist bereits ein Raub im Gange!", true, "fast"] spawn ESG_fnc_notify;
  15. };
  16. if (vehicle player != _robber) exitWith {
  17.     ["Aktion abgebrochen","Steig vorher aus deinem Fahrzeug aus!", true, "fast"] spawn ESG_fnc_notify;
  18. };
  19. if !(alive _robber) exitWith {};
  20. if ((currentWeapon _robber isEqualTo "") || (currentWeapon _robber in ["Binocular", "Rangefinder"])) exitWith {
  21.     ["Aktion abgebrochen","Ohne eine Waffe kannst du die Stadtbank nicht ausrauben!", true, "fast"] spawn ESG_fnc_notify;
  22. };
  23. _cops = (west countSide playableUnits);
  24. if (_cops < 4) exitWith {
  25.     ["Aktion abgebrochen","Es sind nicht genügend Polizisten im Dienst!", true, "fast"] spawn ESG_fnc_notify;
  26. };
  27. _rip = true;
  28. _kassa = 400000 + round(random 100000);
  29. _shop removeAction _action;
  30. _chance = random(100);
  31. [1, "Eine Stadtbank wird gerade überfallen!"] remoteExec["life_fnc_broadcast", west];
  32. [2, "Eine Stadtbank wird gerade überfallen!"] remoteExec["life_fnc_broadcast", west];
  33. disableSerialization;
  34. 5 cutRsc["life_progress", "PLAIN"];
  35. _ui = uiNameSpace getVariable "life_progress";
  36. _progress = _ui displayCtrl 38201;
  37. _pgText = _ui displayCtrl 38202;
  38. _pgText ctrlSetText format["Tresor wird leergeräumt (1%1)...", "%"];
  39. _progress progressSetPosition 0.01;
  40. _cP = 0.005;
  41. if (_rip) then {
  42.     for "_i" from 0 to 1 step 0 do {
  43.         uiSleep 6.5;
  44.         _cP = _cP + 0.01;
  45.         _progress progressSetPosition _cP;
  46.         _pgText ctrlSetText format["Tresor wird leergeräumt (%1%2)...", round(_cP * 100), "%"];
  47.         _Pos = position player; // by ehno: get player pos
  48.         _marker = createMarker["Marker250", _Pos]; //by ehno: Place a Maker on the map
  49.         "Marker250" setMarkerColor "ColorRed";
  50.         "Marker250" setMarkerText "Banküberfall";
  51.         "Marker250" setMarkerType "mil_warning";
  52.         if (_cP >= 1) exitWith {};
  53.         if (_robber distance _shop > 10.5) exitWith {};
  54.         if !(alive _robber) exitWith {};
  55.         if (_robber getVariable["esg_bewusstlos", false]) exitWith {};
  56.     };
  57.     if !(alive _robber) exitWith {
  58.         _rip = false;
  59.     };
  60.     if (player getVariable["esg_bewusstlos", false]) exitWith {
  61.         deleteMarker "Marker250";
  62.         ["Aktion abgebrochen","Du musst in einen Radius von 15m bleiben! Der Tresor wurde nun verriegelt!", true, "fast"] spawn ESG_fnc_notify;
  63.         5 cutText["", "PLAIN"];
  64.         _rip = false;
  65.     };
  66.     if (_robber distance _shop > 10.5) exitWith {
  67.         deleteMarker "Marker250";
  68.         ["Aktion abgebrochen","Du musst in einen Radius von 15m bleiben! Der Tresor wurde nun verriegelt!", true, "fast"] spawn ESG_fnc_notify;
  69.         5 cutText["", "PLAIN"];
  70.         _rip = false;
  71.     };
  72.     5 cutText["", "PLAIN"];
  73.     titleText[format["Du hast $%1 erbeutet! Fliehe lieber bevor die Cops herkommen!", [_kassa] call life_fnc_numberText], "PLAIN"];
  74.     deleteMarker "Marker250"; // by ehno delete maker
  75.     life_cash = life_cash + _kassa;
  76.     _rip = false;
  77.     life_use_atm = false;
  78.     uiSleep(30 + random(180));
  79.     life_use_atm = true;
  80.     if !(alive _robber) exitWith {};
  81.     _log = format["%1 (%2) hat %3 geraubt.", player getVariable["realname", name player], getPlayerUID player, [_kassa]call life_fnc_numberText];
  82.     ["KBANK_LOG", _log] remoteExecCall ["ESG_fnc_logging", 2];
  83. };
  84. uiSleep 300;
  85. _action = _shop addAction["Bank überfallen", life_fnc_robKleinBank];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement