Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Author: H4SHK3KS
- File: fn_robFuelStation.sqf
- Description: enables the robbing of fuel stations
- */
- private["_robber","_shop","_amount","_action","_rip","_chance","_progress","_progressText","_progressValue"];
- _shop = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param;
- _robber = [_this,1,ObjNull,[ObjNull]] call BIS_fnc_param;
- _action = [_this,2] call BIS_fnc_param;
- _amount = 25000 + round(random 35000);
- _rip = false;
- if (_robber distance _shop > 6) exitWith {hint "Du bist zu weit weg um auszurauben!"};
- if (_rip) exitWith {hint "Diese Tankstelle wird bereits ausgeraubt!"};
- if (!(alive player)) exitWith {};
- if (vehicle player != player) exitWith { hint "Steige aus deinem Fahrzeug aus!"};
- if (currentWeapon _robber == "") exitWith {hint "Du hast keine Waffe!"}
- if (west countSide playableUnits < 5) exitWith {hint "Es sind nicht genug Polizisten anwesend!"}
- _rip = true;
- _shop removeAction _action;
- _chance = random(100);
- if(_chance > 50) then { [[1,"Eine Tankstelle wird ausgeraubt"],"life_fnc_broadcast",west,false] spawn life_fnc_MP; };
- disableSerialization;
- 5 cutRsc ["life_progress", "PLAIN"];
- _ui = uiNamespace getVariable "life_progress";
- _progress = _ui displayCtrl 38201;
- _progressText = _ui displayCtrl 38202;
- _progressText ctrlSetText format["Raub in Arbeit, bleib in der Nähe (1%1)","%"]
- _progress progressSetPosition 0.01;
- _progressValue = 0.001;
- if(_rip) then {
- _markerName = "Rob" + str(name player);
- _pos = position player;
- _marker createMarker[_markerName, _pos]
- _markerName setMarkerColor "ColorRed";
- _markerName setMarkerText "Tankstellenraub";
- _markerName setMarkerType "mil_warning";
- _markerName setmarkerSize [5,5];
- while {_progressValue < 1} then {
- sleep 4;
- _progressValue = _progressValue + 0.01;
- _progress progressSetPosition _progressValue;
- _progressText ctrlSetText format["Raub in Arbeit, bleib in der Nähe (%1%2)",round(_progressValue * 100),"%"];
- if (_robber distance _shop > 10 || !(alive player)) exitWith {
- _rip = false;
- deleteMarker _markerName;
- hint "Du musst 10 m im Umkreis sein um auszurauben!"
- if(_chance > 50) then {[[1,"Der Tankstellenraub wurde abgebrochen!"],"life_fnc_broadcast",west,false] spawn life_fnc_MP;};
- sleep 600;
- _action = _shop addAction["Tankstelle ausrauben",life_fnc_robFuelStation];
- };
- };
- };
- 5 cutText ["","PLAIN"];
- titleText[format ["Du hast %1 $ gestohlen, hau ab, bevor die Polizei dich erwischt!",_amount],"PLAIN"];
- life_cash = life_cash + _amount;
- _rip = false;
- life_use_atm = false;
- sleep 600;
- life_use_atm = true;
- if (_chance > 50) then {
- [[getPlayerUID _robber,_robber getVariable["realname",name _robber],"211"],"life_fnc_wantedAdd",false,false] spawn life_fnc_MP;
- };
- deleteMarker _markerName;
- _action = _shop addAction["Tankstelle ausrauben",life_fnc_robFuelStation];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement