Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private["_robber","_shop","_kassa","_ui","_progress","_pgText","_cP","_pos"];
- _shop = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param;
- _robber = [_this,1,ObjNull,[ObjNull]] call BIS_fnc_param;
- _kassa = 1000;
- _action = [_this,2] call BIS_fnc_param;
- if(life_fuelstation_rob) exitWith {};
- if(side _robber != civilian) exitWith {hintSilent "You can't rob this gas station now"};
- if(_robber distance _shop > 5) exitWith {hintSilent "You have to stay 5m near the cashier"};
- if (vehicle player != _robber) exitWith {hintSilent "Get out of your vehicle"};
- if !(alive _robber) exitWith {};
- if (currentWeapon _robber == "") exitWith {hintSilent "Haha, what are you threatening me with? You don't even have a water pistol?"};
- if (currentWeapon player in ["","Binocular","Rangefinder"] ) exitWith {hintSilent "You don't scare me with that thing";};
- if (_kassa isEqualTo 0) exitWith {hintSilent "There is currently no money in the register"};
- if (_shop getVariable ["fuelstation_rob",false]) exitWith {hintSilent "The gas station is already being robbed!";};
- _kassa = 10000 + round(random 10000);
- _shop removeAction _action;
- _shop switchMove "AmovPercMstpSsurWnonDnon";
- _chance = random(100);
- _cops = (west countSide playableUnits);
- if(_cops < 5) exitWith{hintSilent "There aren't enough cops online to rob a gas station";};
- if(_chance >= 1) then {[1,format["!!!ALARM!!! Der Kassierer der Tankstelle: %1 wird gerade ausgeraubt", _shop]] remoteExec ["life_fnc_broadcast",west]; };
- disableSerialization;
- 5 cutRsc ["life_progress","PLAIN"];
- _ui = uiNameSpace getVariable "life_progress";
- _progress = _ui displayCtrl 38201;
- _pgText = _ui displayCtrl 38202;
- _pgText ctrlSetText format["Gas station robbery in progress, stay around (10m) (1%1)...","%"];
- _progress progressSetPosition 0.01;
- _cP = 0.01;
- life_fuelstation_rob = true;
- _shop setVariable ["fuelstation_rob",true,true];
- while{true} do
- {
- uiSleep 5.00;
- _cP = _cP + 0.01;
- _progress progressSetPosition _cP;
- _pgText ctrlSetText format["Gas station robbery in progress, stay around (10m) (%1%2)...",round(_cP * 100),"%"];
- _Pos = position player;
- _marker = createMarker ["Marker200", _Pos];
- "Marker200" setMarkerColor "ColorRed";
- "Marker200" setMarkerText "!!!Achtung Tankstellenraub!!!";
- "Marker200" setMarkerType "mil_warning";
- if(_cP >= 1) exitWith {};
- if(_robber distance _shop > 10.5) exitWith { };
- if!(alive _robber) exitWith {};
- if (currentWeapon _robber == "") exitWith {};
- };
- 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;};
- if!(alive _robber) exitWith {life_fuelstation_rob = false;};
- 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; };
- 5 cutText ["","PLAIN"];
- titleText[format["Du hast %1 Euro gestohlen, die Cops sind bereits auf dem Weg verschwinde nun",[_kassa] call life_fnc_numberText],"PLAIN"];
- deleteMarker "Marker200";
- life_cash = life_cash + _kassa;
- life_use_atm = false;
- life_fuelstation_rob = false;
- _shop setVariable ["fuelstation_rob",false,true];
- uiSleep (30 + random(180));
- life_use_atm = true;
- uiSleep 300;
- _action = _shop addAction["Tankstelle ausrauben",life_fnc_robShops];
- _shop switchMove "";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement