Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.47 KB | None | 0 0
  1. --Actions
  2. Citizen.CreateThread(function()
  3. while true do
  4. Wait(0)
  5.  
  6. if IsControlPressed(0, Keys['E']) and CurrentAction == ACTION_TALK_JOHN then
  7. local pP = GetPlayerPed(-1)
  8. if DoesEntityExist(pP) then
  9. DoScreenFadeOut(1000)
  10. Citizen.Wait(1000)
  11.  
  12. TriggerEvent('malte-cinema:activate')
  13.  
  14. SetEntityCoords(pP, -527.28, -1680.02, 18.32)
  15. SetEntityHeading(pP, 292.38)
  16.  
  17. wanted_model="a_m_m_og_boss_01"
  18. modelHash = GetHashKey(wanted_model)
  19. RequestModel(modelHash)
  20.  
  21. while not HasModelLoaded(modelHash) do
  22. Wait(1)
  23. end
  24.  
  25. local cop = CreatePed(5, modelHash , -524.55, -1679.09, 18.32, 117.32, false, false)
  26. TaskStartScenarioInPlace(cop, "WORLD_HUMAN_AA_SMOKE", 0, true)
  27.  
  28. local cam = CreateCam("DEFAULT_SCRIPTED_FLY_CAMERA", true)
  29. AttachCamToEntity(cam, pP, 2.0,-1.7,0.0, true)
  30. SetCamRot(cam, 0.0,0.0,322.94)
  31. RenderScriptCams(true, false, 0, 1, 0)
  32.  
  33. Citizen.Wait(1000)
  34. FreezeEntityPosition(pP, true)
  35. DoScreenFadeIn(1000)
  36. Citizen.Wait(1500)
  37. TriggerServerEvent("InteractSound_SV:PlayOnSource", "vakt", 0.0)
  38.  
  39. Citizen.Wait(10000)
  40. DoScreenFadeOut(1000)
  41. Citizen.Wait(1000)
  42.  
  43. -- DeletePed(cop)
  44. RenderScriptCams(false, false, 0, 1, 0)
  45. FreezeEntityPosition(pP, false)
  46. SetEntityCoords(pP, -524.27, -1684.23, 18.41)
  47.  
  48. Citizen.Wait(2500)
  49. TriggerEvent('malte-cinema:activate')
  50. DoScreenFadeIn(1000)
  51. Citizen.Wait(2000)
  52.  
  53. CurrentAction = ACTION_MISSION_STARTED
  54. end
  55. end
  56.  
  57. if CurrentAction == ACTION_MISSION_STARTED then
  58. local playerPed = GetPlayerPed(-1)
  59. missionStarted = true
  60. searchingVehicle = true
  61. SetNewWaypoint(1130.14, -1301.72)
  62.  
  63. if missionStarted then
  64. local pos = GetEntityCoords(GetPlayerPed(-1))
  65. local distance = GetDistanceBetweenCoords(pos.x, pos.y, pos.z, 1130.04,-1301.43,33.85, true)
  66. if distance <= 50.0 then
  67. if not carSpawned then
  68. TriggerEvent('spawnVehicle')
  69. Citizen.Wait(5000)
  70. end
  71. end
  72. end
  73. end
  74.  
  75. end
  76. end)
  77.  
  78. Citizen.CreateThread(function()
  79. while true do
  80. Wait(0)
  81.  
  82. if missionStarted then
  83. if searchingVehicle then
  84. drawTxt(0.90, 1.40, 1.0,1.0,0.4, "Åk till ~b~fabriken~w~ och hämta ~g~skåpbilen.", 255, 255, 255, 255)
  85. end
  86. end
  87.  
  88. end
  89. end)
  90.  
  91. RegisterNetEvent('spawnVehicle')
  92. AddEventHandler('spawnVehicle', function()
  93. ESX.Game.SpawnVehicle('rumpo', {
  94. x = 1130.04,
  95. y = -1301.42,
  96. z = 33.85
  97. }, 0.61, function(vehicle)
  98. robberyVan = vehicle
  99. SetVehicleModKit(vehicle, 1)
  100. SetVehicleLivery(vehicle, 1)
  101. carSpawned = true
  102. end)
  103.  
  104. -- if robberyVan ~= nil then
  105. -- DeleteEntity(robberyVan)
  106. -- end
  107.  
  108. end)
  109.  
  110. --Display alerts
  111. Citizen.CreateThread(function()
  112. while true do
  113.  
  114. Wait(0)
  115.  
  116. if CurrentAction ~= nil then
  117. SetTextComponentFormat('STRING')
  118. AddTextComponentString(CurrentActionMsg)
  119. DisplayHelpTextFromStringLabel(0, 0, 1, -1)
  120. end
  121. end
  122. end)
  123.  
  124. function drawTxt(x,y ,width,height,scale, text, r,g,b,a, outline)
  125. SetTextFont(0)
  126. SetTextProportional(0)
  127. SetTextScale(scale, scale)
  128. SetTextColour(r, g, b, a)
  129. SetTextDropShadow(0, 0, 0, 0,255)
  130. SetTextEdge(1, 0, 0, 0, 255)
  131. SetTextDropShadow()
  132. if(outline)then
  133. SetTextOutline()
  134. end
  135. SetTextEntry("STRING")
  136. AddTextComponentString(text)
  137. DrawText(x - width/2, y - height/2 + 0.005)
  138. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement