Advertisement
Guest User

Untitled

a guest
May 31st, 2015
1,395
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 12.48 KB | None | 0 0
  1. --Edit by haws1290 2015
  2. --Used Trifecta's PacificHeist.lua as base script
  3. --Lots of credit to him
  4. --Semi-Scripted Bank Heist for Blaine County Savings
  5.  
  6. local BlaineCountyHeist = {}
  7.  
  8.  
  9.  
  10. function markBank()
  11.         bankBlip = UI.ADD_BLIP_FOR_COORD(-111.5, 6462.1, 31.6)
  12.         UI.SET_BLIP_SCALE(bankBlip, 1)
  13.         UI.SET_BLIP_SPRITE(bankBlip, 52)
  14.         UI.SET_BLIP_COLOUR(bankBlip, 5)
  15.         UI.SET_BLIP_AS_SHORT_RANGE(bankBlip, true)
  16. end
  17.  
  18. --Part 1 = Gate
  19. --Part 2 = Open Safe
  20. --Part 3 = Get Cash
  21. --Part 4 = Escape
  22. --Part 5 = Drop-Off
  23.  
  24. --EDITABLE VARIABLES MADE EASY--
  25. --EDIT THE FOLLOWING SO YOU WON'T HAVE TO SEARCH THE CODE FOR THE CORRECT LINE--
  26. local PayoutMin = 1000000
  27. local PayoutMax = 3500000
  28.  
  29. local wantedLevelPt1 = 1
  30. local wantedLevelPt2 = 2
  31. local wantedLevelPt3 = 3
  32. local wantedLevelPt4 = 4
  33.  
  34. local safeWaitTime = 20000 --Milliseconds
  35. --------------------------------------------------------------------------------
  36.  
  37. --DO NOT EDIT----------------------------
  38. heistPart = 0
  39. local dropOffBlip
  40. local flag01 = false --Near Vault
  41. local flag02 = false --Get Payment
  42. local flag03 = {} --Deposit Boxes
  43. local flag04 = false --Pickup Money
  44. local flag05 = false --Create Pickup Money
  45. local flag06 = false --Spawn Swat
  46. local depoFlag = {}
  47.     depoFlag[0] = false
  48.     depoFlag[1] = false
  49.     depoFlag[2] = false
  50.     depoFlag[3] = false
  51. local bankCashPickup
  52. local depoPay = 0
  53. local obj = {}
  54. local blip = {}
  55. -----------------------------------------
  56.  
  57.  
  58. markBank()
  59.  
  60. function BlaineCountyHeist.unload() end
  61. function BlaineCountyHeist.init()
  62.     for i = 1,5 do
  63.         flag03[i] = false
  64.     end
  65. end
  66.  
  67. --NOT USED, SCRIPTED EXPLOSION. DOESN'T ALWAYS WORK. WILL USE IT WHEN NATIVE GETS UPDATED
  68. function explosion()   
  69.     --255.745,225.310,101.876
  70.     FIRE.ADD_EXPLOSION(253.551, 223.934, 101.900, 5, 0.5, false, false, 1)
  71.     FIRE.ADD_EXPLOSION(252.260,225.383,101.683, 5, 0.5, false, false, 1)
  72.     wait(1000)
  73.     obj[1] = OBJECT.CREATE_OBJECT(GAMEPLAY.GET_HASH_KEY("prop_weight_20k"),255.745,225.310,101.876, false,false,true)
  74.     OBJECT.PLACE_OBJECT_ON_GROUND_PROPERLY(obj[1])
  75.     obj[2] = OBJECT.CREATE_OBJECT(GAMEPLAY.GET_HASH_KEY("prop_weight_20k"),255.521,225.734,101.876, false,false,true)
  76.     OBJECT.PLACE_OBJECT_ON_GROUND_PROPERLY(obj[2])
  77. end
  78.  
  79. function setBlipDropOff()
  80.     dropOffBlip = UI.ADD_BLIP_FOR_COORD(1378.405, -2078.464, 51.999)
  81.     UI.SET_BLIP_COLOUR(dropOffBlip, 16742399)
  82.     UI.SET_BLIP_SCALE(dropOffBlip, 1)
  83.     UI.SET_BLIP_FLASHES(dropOffBlip, true)
  84.     UI.SET_BLIP_ROUTE(dropOffBlip, true)
  85. end
  86.  
  87. function setBlips()
  88.     blip[4] = UI.ADD_BLIP_FOR_COORD(-104.5, 6477.3, 32.5)
  89.     UI.SET_BLIP_COLOUR(blip[4], 16742399)
  90.     UI.SET_BLIP_SCALE(blip[4], 1)
  91.     UI.SET_BLIP_FLASHES(blip[4], true)
  92.     UI.SET_BLIP_ROUTE(blip[4], true)
  93.    
  94.     blip[1] = UI.ADD_BLIP_FOR_COORD(-105.8,6478.4,31.6)
  95.     UI.SET_BLIP_COLOUR(blip[1], 16742399)
  96.     UI.SET_BLIP_SCALE(blip[1], 1)
  97.     UI.SET_BLIP_FLASHES(blip[1], true)
  98.  
  99.    
  100.     blip[2] = UI.ADD_BLIP_FOR_COORD(-103.5 , 6478.5, 31.6)
  101.     UI.SET_BLIP_COLOUR(blip[2], 16742399)
  102.     UI.SET_BLIP_SCALE(blip[2], 1)
  103.     UI.SET_BLIP_FLASHES(blip[2], true)
  104.  
  105.    
  106.     blip[3] = UI.ADD_BLIP_FOR_COORD(-102.9, 6475.6,31.6)
  107.     UI.SET_BLIP_COLOUR(blip[3], 16742399)
  108.     UI.SET_BLIP_SCALE(blip[3], 1)
  109.     UI.SET_BLIP_FLASHES(blip[3], true)
  110.    
  111.     blip[5] = UI.ADD_BLIP_FOR_COORD(-107.3, 6473.83,31.6)
  112.     UI.SET_BLIP_COLOUR(blip[5], 16742399)
  113.     UI.SET_BLIP_SCALE(blip[5], 1)
  114.     UI.SET_BLIP_FLASHES(blip[5], true)
  115.  
  116. end
  117.  
  118. function removeBlip(i)
  119.     UI.REMOVE_BLIP(blip[i])
  120. end
  121.  
  122. function drawText(text, x, y, scale)
  123.   UI.SET_TEXT_FONT(6)
  124.   UI.SET_TEXT_SCALE(scale, scale)
  125.   UI.SET_TEXT_COLOUR(255, 255, 255, 255)
  126.   UI.SET_TEXT_WRAP(0.0, 1.0)
  127.   UI.SET_TEXT_CENTRE(false)
  128.   UI.SET_TEXT_DROPSHADOW(2, 2, 0, 0, 0)
  129.   UI.SET_TEXT_EDGE(1, 0, 0, 0, 205)
  130.   UI._SET_TEXT_ENTRY("STRING")
  131.   UI._ADD_TEXT_COMPONENT_STRING(text)
  132.   UI._DRAW_TEXT(y, x)
  133. end
  134.  
  135. function BlaineCountyHeist.tick()
  136.  
  137.     local playerPed = PLAYER.PLAYER_PED_ID()
  138.     local player = PLAYER.GET_PLAYER_PED(playerPed)
  139.     local location = ENTITY.GET_ENTITY_COORDS(playerPed, nil)
  140.    
  141.     --Is Player Dead?
  142.     if((ENTITY.IS_ENTITY_DEAD(playerPed) == true) and  (heistPart > 0))then
  143.         resetHeist()
  144.     end
  145.    
  146.     --MAIN HEIST--
  147.     --PART 1
  148.     if ((GAMEPLAY.GET_DISTANCE_BETWEEN_COORDS( -111.5, 6462.1, 31.6 , location.x, location.y, location.z, true ) < 1 ) and (heistPart == 0)) then
  149.        
  150.         heistPart = 1 --Start Heist
  151.        
  152.         notify("Make your way to the deposit boxes and money!")
  153.        
  154.         PLAYER.SET_PLAYER_WANTED_LEVEL_NO_DROP(PLAYER.GET_PLAYER_PED(playerPed),wantedLevelPt1,false)
  155.         PLAYER.SET_PLAYER_WANTED_LEVEL_NOW(PLAYER.GET_PLAYER_PED(playerPed),false)
  156.                
  157.         heistPart = 2 --Move to part 2
  158.        
  159.        
  160.     --PART 2
  161.     elseif((GAMEPLAY.GET_DISTANCE_BETWEEN_COORDS( -104.30, 6471.7, 36 , location.x, location.y, location.z, true ) < 6) and (heistPart == 2) and (ENTITY.IS_ENTITY_DEAD(playerPed) == false)) then
  162.        
  163.        
  164.         PLAYER.SET_PLAYER_WANTED_LEVEL_NO_DROP(PLAYER.GET_PLAYER_PED(playerPed),wantedLevelPt2,false)
  165.         PLAYER.SET_PLAYER_WANTED_LEVEL_NOW(PLAYER.GET_PLAYER_PED(playerPed),false)
  166.        
  167.         if(flag01 == false) then --Near Safe
  168.             notify("Enter the deposit box room and empty them for a big score.")
  169.         end
  170.        
  171.         if(GAMEPLAY.GET_DISTANCE_BETWEEN_COORDS( -105.0,6476.44,31.6, location.x, location.y, location.z, true ) < 3) then
  172.             notify("Grab the cash!")
  173.             notify("Press [E] to raid the deposit boxes!")
  174.             PLAYER.SET_PLAYER_WANTED_LEVEL_NO_DROP(PLAYER.GET_PLAYER_PED(playerPed),wantedLevelPt4,false)
  175.             PLAYER.SET_PLAYER_WANTED_LEVEL_NOW(PLAYER.GET_PLAYER_PED(playerPed),false)
  176.             flag01 = true
  177.             heistPart = 3
  178.             setBlips()
  179.         end
  180.    
  181.     elseif((heistPart == 3) and (ENTITY.IS_ENTITY_DEAD(playerPed) == false)) then
  182.    
  183.         PLAYER.SET_PLAYER_WANTED_LEVEL_NO_DROP(PLAYER.GET_PLAYER_PED(playerPed),wantedLevelPt4,false)
  184.         PLAYER.SET_PLAYER_WANTED_LEVEL_NOW(PLAYER.GET_PLAYER_PED(playerPed),false)
  185.    
  186.         if(flag05 == false) then
  187.             bankCashPickup = OBJECT.CREATE_AMBIENT_PICKUP(GAMEPLAY.GET_HASH_KEY("PICKUP_MONEY_VARIABLE"), -104.5, 6477.3, 32.5, 1000, 1, 1, false, true)
  188.             OBJECT.CREATE_AMBIENT_PICKUP(GAMEPLAY.GET_HASH_KEY("PICKUP_MONEY_VARIABLE"), -104.5, 6477.3, 32.5, 1000, 1, 1, false, true)
  189.             OBJECT.CREATE_AMBIENT_PICKUP(GAMEPLAY.GET_HASH_KEY("PICKUP_MONEY_VARIABLE"), -104.5, 6477.3, 32.5, 1000, 1, 1, false, true)
  190.             OBJECT.CREATE_AMBIENT_PICKUP(GAMEPLAY.GET_HASH_KEY("PICKUP_MONEY_VARIABLE"), -104.5, 6477.3, 32.5, 1000, 1, 1, false, true)
  191.             OBJECT.CREATE_AMBIENT_PICKUP(GAMEPLAY.GET_HASH_KEY("PICKUP_MONEY_VARIABLE"), -104.5, 6477.3, 32.5, 1000, 1, 1, false, true)
  192.             OBJECT.CREATE_AMBIENT_PICKUP(GAMEPLAY.GET_HASH_KEY("PICKUP_MONEY_VARIABLE"), -104.5, 6477.3, 32.5, 1000, 1, 1, false, true)
  193.             OBJECT.CREATE_AMBIENT_PICKUP(GAMEPLAY.GET_HASH_KEY("PICKUP_MONEY_VARIABLE"), -104.5, 6477.3, 32.5, 1000, 1, 1, false, true)
  194.             OBJECT.CREATE_AMBIENT_PICKUP(GAMEPLAY.GET_HASH_KEY("PICKUP_MONEY_VARIABLE"), -104.5, 6477.3, 32.5, 1000, 1, 1, false, true)
  195.             flag05 = true
  196.         end
  197.        
  198.         if(GAMEPLAY.GET_DISTANCE_BETWEEN_COORDS( -104.5, 6477.3, 32.5, location.x, location.y, location.z, true ) < 2 and flag04 == false) then
  199.             notify("You collected the cash!")
  200.             notify("Escape, or go for the deposit boxes!")
  201.             notify("Press [L] when you're ready to leave!")
  202.             PED.SET_PED_COMPONENT_VARIATION(playerPed, 9, 1, 0, 0) 
  203.             removeBlip(4)
  204.             flag04 = true
  205.             PLAYER.SET_PLAYER_WANTED_LEVEL_NO_DROP(PLAYER.GET_PLAYER_PED(playerPed),wantedLevelPt4,false)
  206.             PLAYER.SET_PLAYER_WANTED_LEVEL_NOW(PLAYER.GET_PLAYER_PED(playerPed),false)
  207.         end
  208.        
  209.         if(GAMEPLAY.GET_DISTANCE_BETWEEN_COORDS( -105.8,6478.4,31.6 , location.x, location.y, location.z, true ) < 1 and depoFlag[0] == false) then
  210.             drawText("Press [E] to raid the Deposit Box!", 0.5, 0.5, 1)
  211.             if(get_key_pressed(Keys.E))then
  212.                 notify("Looting 1")
  213.                 wait(5000)
  214.                 depoPay = depoPay + 250000
  215.                 flag03[1] = true
  216.                 removeBlip(1)
  217.                 notify("Deposit Box 1 Looted")
  218.                 print("depo1")
  219.                 depoFlag[0] = true
  220.                 PLAYER.SET_PLAYER_WANTED_LEVEL_NO_DROP(PLAYER.GET_PLAYER_PED(playerPed),wantedLevelPt4,false)
  221.                 PLAYER.SET_PLAYER_WANTED_LEVEL_NOW(PLAYER.GET_PLAYER_PED(playerPed),false)
  222.             end
  223.         elseif(GAMEPLAY.GET_DISTANCE_BETWEEN_COORDS( -103.5 , 6478.5, 31.6 , location.x, location.y, location.z, true ) < 1 and depoFlag[1] == false) then
  224.             drawText("Press [E] to raid the Deposit Box!", 0.5, 0.5, 1)
  225.             if(get_key_pressed(Keys.E))then
  226.                 notify("Looting 2")
  227.                 wait(5000)
  228.                 depoPay = depoPay + 250000
  229.                 flag03[2] = true
  230.                 removeBlip(2)
  231.                 notify("Deposit Box 2 Looted")
  232.                 print("depo2")     
  233.                 depoFlag[1] = true
  234.                 PLAYER.SET_PLAYER_WANTED_LEVEL_NO_DROP(PLAYER.GET_PLAYER_PED(playerPed),wantedLevelPt4,false)
  235.                 PLAYER.SET_PLAYER_WANTED_LEVEL_NOW(PLAYER.GET_PLAYER_PED(playerPed),false) 
  236.             end
  237.         elseif(GAMEPLAY.GET_DISTANCE_BETWEEN_COORDS( -102.9, 6475.6,31.6 , location.x, location.y, location.z, true ) < 1 and depoFlag[2] == false) then
  238.             drawText("Press [E] to raid the Deposit Box!", 0.5, 0.5, 1)
  239.             if(get_key_pressed(Keys.E))then
  240.                 notify("Looting 3")
  241.                 wait(5000)
  242.                 depoPay = depoPay + 250000
  243.                 flag03[3] = true
  244.                 removeBlip(3)
  245.                 notify("Deposit Box 3 Looted")
  246.                 print("depo3")
  247.                 depoFlag[2] = true
  248.                 PLAYER.SET_PLAYER_WANTED_LEVEL_NO_DROP(PLAYER.GET_PLAYER_PED(playerPed),wantedLevelPt4,false)
  249.                 PLAYER.SET_PLAYER_WANTED_LEVEL_NOW(PLAYER.GET_PLAYER_PED(playerPed),false)
  250.             end
  251.         elseif(GAMEPLAY.GET_DISTANCE_BETWEEN_COORDS( -107.3, 6473.83,31.6 , location.x, location.y, location.z, true ) < 1 and depoFlag[3] == false) then
  252.             drawText("Press [E] to raid the Deposit Box!", 0.5, 0.5, 1)
  253.             if(get_key_pressed(Keys.E))then
  254.                 notify("Looting 4")
  255.                 wait(5000)
  256.                 depoPay = depoPay + 300000
  257.                 flag03[5] = true
  258.                 removeBlip(5)
  259.                 notify("Deposit Box 4 Looted")
  260.                 print("depo4")
  261.                 depoFlag[3] = true
  262.                 PLAYER.SET_PLAYER_WANTED_LEVEL_NO_DROP(PLAYER.GET_PLAYER_PED(playerPed),wantedLevelPt4,false)
  263.                 PLAYER.SET_PLAYER_WANTED_LEVEL_NOW(PLAYER.GET_PLAYER_PED(playerPed),false)
  264.             end
  265.         end
  266.  
  267.  
  268.         if((flag04 == true and get_key_pressed(Keys.L)) or (flag03[1] == true and flag03[2] == true and flag03[3] == true and flag03[5] == true and flag04 == true)) then
  269.             heistPart = 4
  270.             removeBlip(1)
  271.             removeBlip(2)
  272.             removeBlip(3)
  273.             removeBlip(4)
  274.             removeBlip(5)
  275.             notify("Shoot your way out of the bank and escape the heat!")
  276.         end
  277.        
  278.    
  279.     --PART 4
  280.     elseif((heistPart == 4) and (ENTITY.IS_ENTITY_DEAD(playerPed) == false)) then
  281.         if(GAMEPLAY.GET_DISTANCE_BETWEEN_COORDS(  -103.5 , 6478.5, 31.6 , location.x, location.y, location.z, true ) < 50) then
  282.             PLAYER.SET_PLAYER_WANTED_LEVEL_NO_DROP(PLAYER.GET_PLAYER_PED(playerPed),wantedLevelPt4,false)
  283.             PLAYER.SET_PLAYER_WANTED_LEVEL_NOW(PLAYER.GET_PLAYER_PED(playerPed),false)
  284.         end
  285.        
  286.         if(PLAYER.GET_PLAYER_WANTED_LEVEL(PLAYER.GET_PLAYER_PED_SCRIPT_INDEX(playerPed))<1) then
  287.             heistPart = 5 --Move to part 4
  288.             setBlipDropOff()
  289.         end
  290.    
  291.     --PART 5
  292.     elseif((heistPart == 5 ) and (ENTITY.IS_ENTITY_DEAD(playerPed) == false) and (PLAYER.GET_PLAYER_WANTED_LEVEL(PLAYER.GET_PLAYER_PED_SCRIPT_INDEX(playerPed))<1) and (ENTITY.IS_ENTITY_DEAD(playerPed) == false)) then
  293.         local pickup
  294.        
  295.         notify("Good job. Get to the drop off point to launder your money.")
  296.        
  297.         if ((PLAYER.GET_PLAYER_WANTED_LEVEL(PLAYER.GET_PLAYER_PED_SCRIPT_INDEX(playerPed))<1) and (PLAYER.GET_PLAYER_WANTED_LEVEL(PLAYER.GET_PLAYER_PED_SCRIPT_INDEX(playerPed))<1) and (GAMEPLAY.GET_DISTANCE_BETWEEN_COORDS( 1378.405, -2078.464, 51.999 , location.x, location.y, location.z, true ) < 10)) then
  298.            
  299.             if not(flag02) then
  300.                 math.randomseed(os.time())
  301.                 local finalPayout =math.random (PayoutMin, PayoutMax)
  302.                 pickup = OBJECT.CREATE_AMBIENT_PICKUP(GAMEPLAY.GET_HASH_KEY("PICKUP_MONEY_SECURITY_CASE"), 1378.405, -2078.464, 51.999, 0, finalPayout+depoPay, 1, false, true)
  303.                 flag02 = true
  304.             end
  305.            
  306.             if(PLAYER.GET_PLAYER_WANTED_LEVEL(PLAYER.GET_PLAYER_PED_SCRIPT_INDEX(playerPed))<1) and (GAMEPLAY.GET_DISTANCE_BETWEEN_COORDS( 1378.405, -2078.464, 51.999 , location.x, location.y, location.z, true ) < 1) then
  307.                 PED.SET_PED_COMPONENT_VARIATION(playerPed, 9, 0, 0, 0)
  308.                 resetHeist()
  309.                 AUDIO.PLAY_MISSION_COMPLETE_AUDIO("MICHAEL_BIG_01")
  310.                 notify("Good Job!")
  311.             end
  312.         end
  313.     end
  314. end
  315.  
  316. --RESETS EVERYTHING---------------------------
  317. --DO NOT EDIT OR RISK BREAKING REPLAYABILITY--
  318. function resetHeist()
  319.     flag01 = false
  320.     flag02 = false
  321.     flag04 = false
  322.     flag05 = false
  323.     flag06 = false
  324.     flag03[1] = false
  325.     flag03[2] = false
  326.     flag03[3] = false
  327.     flag03[4] = false
  328.     flag03[5] = false
  329.     depoFlag[0] = false
  330.     depoFlag[1] = false
  331.     depoFlag[2] = false
  332.     depoFlag[3] = false
  333.     heistPart = 0
  334.     UI.REMOVE_BLIP(dropOffBlip)
  335. end
  336.  
  337. return BlaineCountyHeist
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement