Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Actions
- Citizen.CreateThread(function()
- while true do
- Wait(0)
- if IsControlPressed(0, Keys['E']) and CurrentAction == ACTION_TALK_JOHN then
- local pP = GetPlayerPed(-1)
- if DoesEntityExist(pP) then
- DoScreenFadeOut(1000)
- Citizen.Wait(1000)
- TriggerEvent('malte-cinema:activate')
- SetEntityCoords(pP, -527.28, -1680.02, 18.32)
- SetEntityHeading(pP, 292.38)
- wanted_model="a_m_m_og_boss_01"
- modelHash = GetHashKey(wanted_model)
- RequestModel(modelHash)
- while not HasModelLoaded(modelHash) do
- Wait(1)
- end
- local cop = CreatePed(5, modelHash , -524.55, -1679.09, 18.32, 117.32, false, false)
- TaskStartScenarioInPlace(cop, "WORLD_HUMAN_AA_SMOKE", 0, true)
- local cam = CreateCam("DEFAULT_SCRIPTED_FLY_CAMERA", true)
- AttachCamToEntity(cam, pP, 2.0,-1.7,0.0, true)
- SetCamRot(cam, 0.0,0.0,322.94)
- RenderScriptCams(true, false, 0, 1, 0)
- Citizen.Wait(1000)
- FreezeEntityPosition(pP, true)
- DoScreenFadeIn(1000)
- Citizen.Wait(1500)
- TriggerServerEvent("InteractSound_SV:PlayOnSource", "vakt", 0.0)
- Citizen.Wait(10000)
- DoScreenFadeOut(1000)
- Citizen.Wait(1000)
- -- DeletePed(cop)
- RenderScriptCams(false, false, 0, 1, 0)
- FreezeEntityPosition(pP, false)
- SetEntityCoords(pP, -524.27, -1684.23, 18.41)
- Citizen.Wait(2500)
- TriggerEvent('malte-cinema:activate')
- DoScreenFadeIn(1000)
- Citizen.Wait(2000)
- CurrentAction = ACTION_MISSION_STARTED
- end
- end
- if CurrentAction == ACTION_MISSION_STARTED then
- local playerPed = GetPlayerPed(-1)
- missionStarted = true
- searchingVehicle = true
- SetNewWaypoint(1130.14, -1301.72)
- if missionStarted then
- local pos = GetEntityCoords(GetPlayerPed(-1))
- local distance = GetDistanceBetweenCoords(pos.x, pos.y, pos.z, 1130.04,-1301.43,33.85, true)
- if distance <= 50.0 then
- if not carSpawned then
- TriggerEvent('spawnVehicle')
- Citizen.Wait(5000)
- end
- end
- end
- end
- end
- end)
- Citizen.CreateThread(function()
- while true do
- Wait(0)
- if missionStarted then
- if searchingVehicle then
- 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)
- end
- end
- end
- end)
- RegisterNetEvent('spawnVehicle')
- AddEventHandler('spawnVehicle', function()
- ESX.Game.SpawnVehicle('rumpo', {
- x = 1130.04,
- y = -1301.42,
- z = 33.85
- }, 0.61, function(vehicle)
- robberyVan = vehicle
- SetVehicleModKit(vehicle, 1)
- SetVehicleLivery(vehicle, 1)
- carSpawned = true
- end)
- -- if robberyVan ~= nil then
- -- DeleteEntity(robberyVan)
- -- end
- end)
- --Display alerts
- Citizen.CreateThread(function()
- while true do
- Wait(0)
- if CurrentAction ~= nil then
- SetTextComponentFormat('STRING')
- AddTextComponentString(CurrentActionMsg)
- DisplayHelpTextFromStringLabel(0, 0, 1, -1)
- end
- end
- end)
- function drawTxt(x,y ,width,height,scale, text, r,g,b,a, outline)
- SetTextFont(0)
- SetTextProportional(0)
- SetTextScale(scale, scale)
- SetTextColour(r, g, b, a)
- SetTextDropShadow(0, 0, 0, 0,255)
- SetTextEdge(1, 0, 0, 0, 255)
- SetTextDropShadow()
- if(outline)then
- SetTextOutline()
- end
- SetTextEntry("STRING")
- AddTextComponentString(text)
- DrawText(x - width/2, y - height/2 + 0.005)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement