Advertisement
Guest User

Script

a guest
Jul 17th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.16 KB | None | 0 0
  1. #include "..\..\script_macros.hpp"
  2. /*
  3. File: fn_Robshops.sqf
  4. Author: MrKraken
  5. Description:
  6. Modified by: Pril and Edward Chan
  7. */
  8. private ["_robber","_shop","_kassa","_ui","_pgText","_progress","_cP","_rip","_action"];
  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. if(side _robber !=civilian) exitWith {hint "You need to be a civilian to rob this shop.";};
  14. if(_robber distance _shop > 8) exitWith {hint "You need to stay within 8m to rob this shop";};
  15. if (vehicle player !=_robber) exitWith {hint "You need to be out of your vehicle first!";};
  16.  
  17. if!(alive _robber) exitWith {};
  18. if ((currentWeapon player isEqualTo "") || (currentWeapon player == "Binoculars")) exitWith {hint "You need a weapons to rob this shop!";};
  19.  
  20. _rip = true;
  21. _kassa = 10000 + round(random 50000)};
  22. _shop removeAction _action;
  23. //[_shop, _action, 300] remoteExec ["life_fnc_shopRobbed",civilian];
  24. _chance = random(100);
  25.  
  26. private _locaName = text (nearestLocations [position player, ["NameCityCapital", "NameCity"], 10000] select 0);
  27. if(_chance >=60) then {
  28. [1,format["000 ALERT:\n\nA gas station is being robbed by %2 near %3",_robber, name _robber, _locaName]] remoteExec ["life_fnc_broadcast",west]
  29. };
  30.  
  31. disableSerialization;
  32. 5 cutRsc ["life_progress", "PLAIN"];
  33. _ui = uiNamespace getVariable "life_progress";
  34. _progress = _ui displayCtrl 38201;
  35. _pgText = _ui displayCtrl 38202;
  36. _pgText ctrlSetText format["Robbing Shop, stay close (8m) (1%1)...","%"];
  37. _progress progressSetPosition 0.01;
  38. _cP = 0.01;
  39.  
  40. if(_rip) then
  41. {
  42. while{true} do
  43. {
  44. sleep 0.85;
  45. _cP = _cP + 0.01;
  46. _progress progressSetPosition _cP;
  47. _pgText ctrlSetText format ["Robbing Shop, stay close (3m) (%1%2)...",round(_cP * 100), "%"];
  48.  
  49. if (LIFE_SETTINGS(getNumber,"robberyMarkers") isEqualTo 1) then {
  50. _marker = createMarker ["stationRobbery", _shop];
  51. _marker setMarkerColor "ColorRed";
  52. _marker setMarkerText "Station Robbery in Progress! Approach with Caution!";
  53. _marker setMarkerType "mil_warning";
  54. };
  55.  
  56. if(_cP >=1) exitWith {};
  57. if(_robber distance _shop > 3.5) exitWith{};
  58. if!(alive _robber) exitWith {};
  59. };
  60.  
  61. if(_robber getVariable "restrained") exitWith {_rip = false; hint "You have been restrained!";}; //Player got arrested, or restrained by another player!
  62. if(_robber getVariable "ziptied") exitWith {_rip = false; hint "You have been ziptied!";}; //Player got ziptied
  63. if(life_istazed) exitWith {_rip = false; hint "You were tazed!";}; //Player was tazed
  64. if!(alive _robber) exitWith {_rip = false;};
  65.  
  66. if(_robber distance _shop > 8.5) exitWith {
  67. hint "You need to stay within 8m to rob this shop! Cash register is now locked, and police have been notified!";
  68. 5 cutText ["","PLAIN"];
  69. [1,format["%1 attempted to rob a gas station!",_robber,name _robber]] remoteExec ["life_fnc_broadcast",west];
  70. [getPlayerUID _robber, _robber getVariable ["realname",name _robber], "211"] remoteExecCall ["life_fnc_wantedAdd", RSERV];
  71. };
  72. 5 cutText ["","PLAIN"];
  73.  
  74. titleText[format["You managed to steal %1, now get away before the cops arrive!",[_kassa] call life_fnc_numberText], "PLAIN"];
  75. life_cash = life_cash + _kassa;
  76. deleteMarker _marker;
  77. _rip = false;
  78. life_use_atm = false;
  79. playSound3D ["A3\Sounds_F\sfx\alarm_independent.wss", _robber];
  80. sleep 25;
  81. [1, format["AAN: A gas station was recently robbed for a total of $%2", [_kassa] call life_fnc_numberText]] remoteExec ["life_fnc_broadcast", civilian];
  82. sleep ((LIFE_SETTINGS(getNumber,"noatm_timer")) * 60);
  83. life_use_atm = true;
  84. _shop addAction;
  85. if!(alive _robber) exitWith {};
  86. [getPlayerUID _robber, _robber getVariable ["realname",name _robber], "211"] remoteExecCall ["life_fnc_wantedAdd", RSERV];
  87. call SOCK_fnc_updatePartial;
  88. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement