Advertisement
Klowns

Untitled

Feb 26th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 4.50 KB | None | 0 0
  1. /*  
  2. file: fn_robShops.sqf  
  3. Author: MrKraken  
  4. Made from MrKrakens bare-bones shop robbing tutorial on www.altisliferpg.com forums  
  5. Description:  
  6. Executes the rob shob action!  
  7. Idea developed by PEpwnzya v1.0  
  8. */  
  9. private["_robber","_shop","_kassa","_ui","_progress","_pgText","_cP","_rip","_pos"];  
  10. _shop = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param; //The object that has the action attached to it is _this. ,0, is the index of object, ObjNull is the default should there be nothing in the parameter or it's broken  
  11. _robber = [_this,1,ObjNull,[ObjNull]] call BIS_fnc_param; //Can you guess? Alright, it's the player, or the "caller". The object is 0, the person activating the object is 1  
  12. //_kassa = 1000; //The amount the shop has to rob, you could make this a parameter of the call (https://community.bistudio.com/wiki/addAction). Give it a try and post below ;)  
  13. _action = [_this,2] call BIS_fnc_param;//Action name  
  14.  
  15. if(side _robber != civilian) exitWith { hint "Tu ne peux pas dérober cette station" };  
  16. if(_robber distance _shop > 5) exitWith { hint "Tu dois etre a 5 mètres" };  
  17.  
  18. if !(_kassa) then { _kassa = 1000; };  
  19. if (_rip) exitWith { hint "Avancement du braquage!" };  
  20. if (vehicle player != _robber) exitWith { hint "Sors de ton véhicule!" };  
  21.  
  22. if !(alive _robber) exitWith {};  
  23. if (currentWeapon _robber == "") exitWith { hint "HaHa, ne me menace pas connard! Casses-toi !" };  
  24. if (_kassa == 0) exitWith { hint "La caisse est vide!" };// si il n'y a rien dans la caisse alors elle est vide (suite a un braquage)  
  25.  
  26. _rip = true;  
  27. _kassa = 20000 + round(random 10000);//20000= le nombre minimal de la recette + suivant d'un "tirage au hasard"  
  28. _shop removeAction _action;  
  29. _shop switchMove "AmovPercMstpSsurWnonDnon";  
  30. _chance = random(100);  
  31. if(_chance < 100) then { hint "Le caissier avait une alarme secrete, la police arrive!"; [1,format["ALERTE la Station service: %1 est dérobé!", _shop]] remoteExecCall ["life_fnc_broadcast",west]; }; //une chance sur 2 que la police sois contacter pendant le braquage  
  32. playSound3D ["A3\Sounds_F\sfx\alarm_independent.wss", _robber];
  33. sleep 25;
  34. //0 = [parseText "<t size='2.3'>BRAQUAGE EN COURS!</t><br />Braquage en cours",parseText "faite attention les braqueurs sont armés et determiné. - Les forces de l'ordre sont sur place et la zone a été bloqué. Pour votre sécurité, ne vous rendez pas dans la zone"] spawn BIS_fnc_AAN;
  35. //30 cutText ["","PLAIN"];
  36. _cops = (west countSide playableUnits);  
  37. if(_cops < 2) exitWith{[[_vault,-1],"disableSerialization;",false,false] spawn life_fnc_MP; hint "Il n'y a pas assez de policiers!";}; //2 est le nombre de policiers necessaire  
  38. disableSerialization;  
  39. 5 cutRsc ["life_progress","PLAIN"];  
  40. _ui = uiNameSpace getVariable "life_progress";  
  41. _progress = _ui displayCtrl 38201;  
  42. _pgText = _ui displayCtrl 38202;  
  43. _pgText ctrlSetText format["Progression du braquage (tu dois être à 10m) (1%1)...","%"];  
  44. _progress progressSetPosition 0.01;  
  45. _cP = 0.01;  
  46. if(_rip) then  
  47. {  
  48. while{true} do  
  49. {  
  50. sleep 4;  
  51. _cP = _cP + 0.01;  
  52. _progress progressSetPosition _cP;  
  53. _pgText ctrlSetText format["Progression du braquage (tu dois être à 10m) (%1%2)...",round(_cP * 100),"%"];  
  54. _Pos = position player; // by ehno: get player pos  
  55.                                 _marker = createMarker ["Marker200", _Pos]; //by ehno: Place a Maker on the map  
  56.                                 "Marker200" setMarkerColor "ColorRed";  
  57.                                 "Marker200" setMarkerText "Attention un braquage a lieu !";  
  58.                                 "Marker200" setMarkerType "mil_warning";  
  59. if(_cP >= 1) exitWith {};  
  60. if(_robber distance _shop > 10.5) exitWith { };  
  61. if!(alive _robber) exitWith {};  
  62. };  
  63. if!(alive _robber) exitWith { _rip = false; };  
  64. if(_robber distance _shop > 10.5) exitWith { deleteMarker "Marker200"; _shop switchMove ""; hint "Tu as besoin de resté à 10m pour que le braquage continue !"; 5 cutText ["","PLAIN"]; _rip = false; };  
  65. 5 cutText ["","PLAIN"];  
  66.  
  67. titleText[format["Vous avez volé $%1, maintenant partez, les flics arrivent !",[_kassa] call life_fnc_numberText],"PLAIN"];  
  68. deleteMarker "Marker200"; // by ehno delete maker  
  69. life_cash = life_cash + _kassa;  
  70.  
  71. _rip = false;  
  72. life_use_atm = false;  
  73. sleep (60 + random(180));  
  74. life_use_atm = true;  
  75. if!(alive _robber) exitWith {};  
  76. [[getPlayerUID _robber,name _robber,"211"],"life_fnc_wantedAdd",false,false] spawn life_fnc_MP;  
  77. };  
  78. sleep 300;  
  79. _action = _shop addAction["Braquer la station service",life_fnc_robShops];  
  80. _shop switchMove "";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement