Advertisement
Guest User

Untitled

a guest
Feb 1st, 2015
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 KB | None | 0 0
  1. /*
  2. File: fn_robgasStation.sqf
  3. Author: RIB
  4.  
  5. */
  6. if(life_inv_screwdriver < 1) exitWith { hint "You need screwdriver to perform that action";};
  7. private["_robber","_timer","_funds"];
  8.  
  9. _vault = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param;
  10. _funds = 10000 + round(random 10000);
  11.  
  12. if(player distance _vault > 10) exitWith {[[_vault,-1],"TON_fnc_robberyState",false,false] spawn life_fnc_MP; hint "You were to stay within 10m of the target!"};
  13.  
  14. _timer = time + (20 * 60); //Default timer is 20 minutes to rob.
  15. titleText["Robbing the News Agents...","PLAIN"];
  16. [[2,"<> Timmies news agents is being robbed<>!!! $$$"],"life_fnc_broadcast",nil,false] spawn life_fnc_MP;
  17. //[[_vault],"life_fnc_bankalarmsound",nil,true] spawn life_fnc_MP; Custom line, delete or keep commented out.
  18.  
  19. while {true} do
  20. {
  21. //Timer display (TO BE REPLACED WITH A NICE GUI LAYER)
  22. _countDown = [(_timer - time),"MM:SS.MS"] call BIS_fnc_secondsToString;
  23. hintSilent format["You need to stay within 15m!\n\nTime Remaining:\n %1\n\nDistance: %2m",_countDown,round(player distance _vault)];
  24.  
  25. if(player distance _vault > 15) exitWith {_toFar = true;};
  26. if((round(_timer - time)) < 1) exitWith {};
  27. if(!alive player) exitWith {};
  28. if(life_istazed) exitWith {};
  29. sleep 0.1;
  30. };
  31.  
  32. switch(true) do
  33. {
  34. case (_toFar):
  35. {
  36. hint "You went to far from the news agents, the robbery has failed!";
  37. [[_vault,0],"TON_fnc_robberyState",false,false] spawn life_fnc_MP;
  38. };
  39.  
  40. case (!alive player):
  41. {
  42. hint "Because you died the robbery over failed.";
  43. [[_vault,0],"TON_fnc_robberyState",false,false] spawn life_fnc_MP;
  44. };
  45.  
  46. case (life_istazed):
  47. {
  48. hint "You were tazed, the robbery has failed!";
  49. [[_vault,0],"TON_fnc_robberyState",false,false] spawn life_fnc_MP;
  50. };
  51.  
  52. case ((round(_timer - time)) < 1):
  53. {
  54. hint format["You have successfully robbed the News agents!\n\nTo avoid the cops and rebels tracing you, your bank card will not work for 8 minutes",[_funds] call life_fnc_numberText];
  55. [] spawn
  56. {
  57. life_use_atm = false;
  58. sleep 480;
  59. life_use_atm = true;
  60. };
  61. _robber = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param;
  62. if(isNull _robber) exitWith {}; //No one to return it to?
  63. if(isNil "life_session_station") then {life_session_station = false;};
  64. if(life_session_station) exitWith {hint "You have already robbed the News Agents wait 20 minutes.";};
  65.  
  66. life_cash = life_cash + _funds; //Self explanatory
  67. hint format["Timmies News Agents was robbed and money was stolen $%1",_funds]; //Give them a nice message
  68. };//Close the if statement
  69.  
  70. };
  71. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement