Advertisement
Guest User

Untitled

a guest
Feb 12th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.21 KB | None | 0 0
  1. #include "..\..\script_macros.hpp"
  2. /*
  3. File: fn_Robshops.sqf
  4. Author: MrKraken
  5.  
  6. Description:
  7.  
  8. Modified by: Pril
  9.  
  10.  
  11. */
  12. private ["_robber","_shop","_kassa","_ui","_pgText","_progress","_cP","_rip","_action"];
  13.  
  14. _shop = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param;
  15. _robber = [_this,1,ObjNull,[ObjNull]] call BIS_fnc_param;
  16. _action = [_this,2] call BIS_fnc_param;
  17.  
  18. _cops = (west countSide playableUnits);
  19.  
  20. if(side _robber !=civilian) exitWith {hint "Oulah, j'ai vu qui vous etes ! Vous ne pouvez pas me braquer !";};
  21. if(_cops < 2) exitWith{[[_vault,-1],"disableSerialization;",false,false] spawn life_fnc_MP; hint "Il n'y a pas assez de Gendarmes!";};
  22. if(_robber distance _shop > 3) exitWith {hint "C'est n'est pas une caisse portable, restez a 3m !";};
  23. if (vehicle player !=_robber) exitWith {hint "On n'est pas au drive, descend de ton vehicule !";};
  24.  
  25. if!(alive _robber) exitWith {};
  26. if (currentWeapon _robber isEqualTo "") exitWith {hint "Tu me fais pas peur, degage de la !";};
  27.  
  28. _rip = true;
  29. _kassa = 5000 + round(random 75000);
  30. _shop removeAction _action;
  31. _chance = random(100); // Descendre cette valeur pour avoir moins de chance d'obtenir beaucoup d'argent.
  32.  
  33. if(_chance >=20) then {
  34. [1,format["ALERTE BIPEUR : UN BRAQUAGE EST EN COURS DANS UN SFR !!!"]] remoteExec ["life_fnc_broadcast",west]
  35. };
  36.  
  37. disableSerialization;
  38. 5 cutRsc ["life_progress", "PLAIN"];
  39. _ui = uiNamespace getVariable "life_progress";
  40. _progress = _ui displayCtrl 38201;
  41. _pgText = _ui displayCtrl 38202;
  42. _pgText ctrlSetText format["BRAQUAGE EN COURS RESTEZ A (3m) (1%1)...","%"];
  43. _progress progressSetPosition 0.01;
  44. _cP = 0.01;
  45.  
  46. if(_rip) then
  47. {
  48. while{true} do
  49. {
  50. sleep 1.70;
  51. _cP = _cP + 0.01;
  52. _progress progressSetPosition _cP;
  53. _pgText ctrlSetText format ["BRAQUAGE EN COURS RESTEZ A (3m) (%1%2)...",round(_cP * 100), "%"];
  54.  
  55. if (LIFE_SETTINGS(getNumber,"robberyMarkers") isEqualTo 1) then {
  56. _marker = createMarker ["Marker200", _shop];
  57. "Marker200" setMarkerColor "ColorRed";
  58. "Marker200" setMarkerText "/!\ATTENTION : BRAQUAGE EN COURS /!\";
  59. "Marker200" setMarkerType "mil_warning";
  60. };
  61.  
  62. if(_cP >=2) exitWith {};
  63. if(_robber distance _shop > 3.5) exitWith{};
  64. if!(alive _robber) exitWith {};
  65. };
  66.  
  67. if(_robber getVariable "restrained") exitWith {_rip = false; hint "Vous avez ete menotte !!";}; //Player got arrested, or restrained by another player!
  68. if(life_istazed) exitWith {_rip = false; hint "Vous avez ete neutraliser !!";}; //Player was tazed
  69. if!(alive _robber) exitWith {_rip = false;};
  70.  
  71. if(_robber distance _shop > 3.5) exitWith {
  72. hint "Vous avez fait tombe la caisse en vous eloignant ! Barrez vous la Gendarmerie arrive !";
  73. deleteMarker "Marker200";
  74. 5 cutText ["","PLAIN"];
  75. [1,format["ALERTE : UN JARDILAND A SUBI UNE TENTATIVE DE BRAQUAGE !",_robber,name _robber, _shop]] remoteExec ["life_fnc_broadcast",west];
  76. [getPlayerUID _robber, _robber getVariable ["realname",name _robber], "211"] remoteExecCall ["life_fnc_wantedAdd", RSERV];
  77. };
  78. 5 cutText ["","PLAIN"];
  79.  
  80. titleText[format["Vous avez reussi a prendre €%1 , la Gendarmerie arrive !",[_kassa] call life_fnc_numberText], "PLAIN"];
  81. life_cash = life_cash + _kassa;
  82. deleteMarker "Marker200";
  83. _rip = false;
  84. life_use_atm = false;
  85. playSound3D ["A3\Sounds_F\sfx\alarm_independent.wss", _robber];
  86. sleep 25;
  87. [1, format["ALERTE : UN JARDILAND VIEN D'ETRE BRAQUER POUR UNE VALEUR TOTAL DE €%1",[_kassa] call life_fnc_numberText]] remoteExec ["life_fnc_broadcast", civilian];
  88. sleep ((LIFE_SETTINGS(getNumber,"noatm_timer")) * 60);
  89. life_use_atm = true;
  90. if!(alive _robber) exitWith {};
  91. [getPlayerUID _robber, _robber getVariable ["realname",name _robber], "211"] remoteExecCall ["life_fnc_wantedAdd", RSERV];
  92. call SOCK_fnc_updatePartial;
  93. };
  94. sleep 1200; //20 Minutes
  95. _action = _shop addAction["Braquer le SFR",life_fnc_robShops,civilian];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement