Darihon

Bank Robbery v1

Jun 6th, 2014
448
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.45 KB | None | 0 0
  1. private ["_random","_random2","_silver","_silver10oz","_gold","gold10oz","_briefcase"];
  2.  
  3. // Checks if script is active, thanks Halvhjearne <3
  4. if(isNil "script_in_progress")then{
  5.     script_in_progress = false;
  6. };
  7.  
  8. if(script_in_progress)exitwith{
  9.     systemChat "This script is only useable once (untill restart)!";
  10. };
  11. script_in_progress = true;
  12. // End Checks if Script is active
  13.  
  14.  
  15. cutText [format["You are about to rob the bank, your have 30 percent chance to get loot."], "PLAIN DOWN"];
  16. sleep 5;
  17.  
  18. // Currency //
  19. _silver = "ItemSilverBar";
  20. _silver10oz = "ItemSilverBar10oz";
  21. _gold = "ItemGoldBar";
  22. _gold10oz = "ItemGoldBar10oz";
  23. _briefcase = "ItemBriefcase100oz";
  24.  
  25. // Makes sure that the game checks for the 30 percent.
  26. _random = floor(random 11); //0-10
  27. if (_random <= 3) then {
  28.     cutText [format["You are robbing the bank, the police has been warned. It takes 5 minutes before the bank robbery is succesfull."], "PLAIN DOWN"];
  29.     sleep 5;
  30.     [nil,nil,rTitleText,"The bank is getting robbed!", "PLAIN",10] call RE;
  31.     sleep 55;
  32.     cutText [format["4 minutes left.."], "PLAIN DOWN"];
  33.     sleep 60;
  34.     cutText [format["3 minutes left.."], "PLAIN DOWN"];
  35.     sleep 60;
  36.     cutText [format["2 minutes left.."], "PLAIN DOWN"];
  37.     sleep 60;
  38.     cutText [format["1 minute left.."], "PLAIN DOWN"];
  39.     sleep 60;
  40.     player playActionNow "Medic";
  41.     sleep 8;
  42.     [nil,nil,rTitleText,"The bank has been robbed succesfully!", "PLAIN",10] call RE;
  43.     _random2 = floor(random 6);
  44.     // Makes an another random section, which chooses the loot randomly.
  45.         if (_random2 == 0) then {
  46.             cutText [format["The vault was emptied recently, no big loot, except some silver."], "PLAIN DOWN"];
  47.             player addMagazine _silver10oz;
  48.             player addMagazine _silver10oz;
  49.             player addMagazine _silver;
  50.             systemChat "The robber got: 2x Silver10oz and 1x Silver";
  51.         };
  52.         if (_random2 == 1) then {
  53.             cutText [format["Some gold, not much."], "PLAIN DOWN"];
  54.             player addMagazine _gold;
  55.             player addMagazine _gold;
  56.             systemChat "The robber got: 2x gold";
  57.         }; 
  58.         if (_random2 == 2) then {
  59.             cutText [format["Nice job!"], "PLAIN DOWN"];
  60.             player addMagazine _gold10oz;
  61.             player addMagazine _gold10oz;
  62.             player addMagazine _gold10oz;
  63.             player addMagazine _gold10oz;
  64.             player addMagazine _gold10oz;
  65.             systemChat "The robber got: 5x gold10oz";
  66.         };
  67.         if (_random2 == 3) then {
  68.             cutText [format["Some gold, not much."], "PLAIN DOWN"];
  69.             player addMagazine _gold;
  70.             player addMagazine _gold;
  71.             player addMagazine _gold10oz;
  72.             systemChat "The robber got: 2x gold and 1x Gold10oz";
  73.         };     
  74.         if (_random2 == 4) then {
  75.             cutText [format["The vault was emptied recently, no big loot, except some silver."], "PLAIN DOWN"];
  76.             player addMagazine _silver10oz;
  77.             player addMagazine _silver10oz;
  78.             player addMagazine _silver;
  79.             systemChat "The robber got: 2x Silver10oz and 1x Silver";
  80.         };
  81.         if (_random2 == 5) then {
  82.             cutText [format["Jack.. Jack.. Pot!!"], "PLAIN DOWN"];
  83.             player addMagazine _briefcase;
  84.             player addMagazine _briefcase;
  85.             systemChat "Ting ting ting... The jackpot has been stolen! Bye bye 2 briefcases";
  86.         }; 
  87.         // Output if above is not activated.
  88.             } else {
  89.                 cutText [format["Bank robbery failed.."], "PLAIN DOWN"];
  90.                 systemChat "Bank robbery failed!";
  91.             };
  92. // sleep seconds;
  93. // script_in_progress = false;
  94. /* Remove the // to enable the script to able to be used again.
  95. By "sleep seconds:" i.e: sleep 60; (able to use script after 60 seconds again).
  96. */
Add Comment
Please, Sign In to add comment