Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local cJ = false
- local eJE = false
- ESX = nil
- local HasAlreadyEnteredMarker = false
- local LastZone = nil
- local CurrentAction = nil
- local CurrentActionMsg = ''
- local CurrentActionData = {}
- Citizen.CreateThread(function()
- while ESX == nil do
- TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
- Citizen.Wait(0)
- end
- end)
- AddEventHandler('quest:hasEnteredMarker', function(zone)
- CurrentAction = 'quest_menu'
- CurrentActionMsg = _U('Tryck E för att snacka med Biggie')
- CurrentActionData = {zone = zone}
- end)
- AddEventHandler('quest:hasExitedMarker', function(zone)
- CurrentAction = nil
- ESX.UI.Menu.CloseAll()
- end)
- if IsControlJustPressed(0, 38) and CurrentAction == 'quest_menu' then
- TriggerEvent("quest")
- end
- RegisterNetEvent("quest")
- AddEventHandler('quest', function()
- if cJ == true then
- return
- end
- local pP = GetPlayerPed(-1)
- if DoesEntityExist(pP) then
- local playerOldLoc = GetEntityCoords(pP, true)
- DoScreenFadeOut(1000)
- TriggerServerEvent("InteractSound_SV:PlayOnSource", "cuffs", 1.0)
- Citizen.Wait(1000)
- SetEntityCoords(pP, -20, -1447.03, 30.7)
- SetEntityHeading(pP, 270.0)
- wanted_model="S_M_Y_COP_01"
- modelHash = GetHashKey(wanted_model)
- RequestModel(modelHash)
- while not HasModelLoaded(modelHash) do
- Wait(1)
- end
- local cop = CreatePed(5, modelHash , -14.27, -1442.81, 31.1, 178.05, false, false)
- TaskStartScenarioInPlace(cop, "WORLD_HUMAN_PAPARAZZI", 0, true)
- local cam = CreateCam("DEFAULT_SCRIPTED_FLY_CAMERA", true)
- AttachCamToEntity(cam, pP, 0.0,7.0,0.0, true)
- SetCamRot(cam, 0.0,0.0,90.0)
- RenderScriptCams(true, false, 0, 1, 0)
- Citizen.Wait(1000)
- FreezeEntityPosition(pP, true)
- DoScreenFadeIn(1000)
- Citizen.Wait(10000)
- DoScreenFadeOut(1000)
- Citizen.Wait(1000)
- DeletePed(cop)
- RenderScriptCams(false, false, 0, 1, 0)
- FreezeEntityPosition(pP, false)
- SetEntityCoords(pP, -14.16, -1448.4, 30.65)
- Citizen.Wait(2500)
- DoScreenFadeIn(1000)
- end
- end)
- -- Display markers
- Citizen.CreateThread(function()
- while true do
- Wait(0)
- local coords = GetEntityCoords(GetPlayerPed(-1))
- for k,v in pairs(Config.Zones) do
- for i = 1, #v.Pos, 1 do
- if(Config.Type ~= -1 and GetDistanceBetweenCoords(coords, v.Pos[i].x, v.Pos[i].y, v.Pos[i].z, true) < Config.DrawDistance) then
- DrawMarker(Config.Type, v.Pos[i].x, v.Pos[i].y, v.Pos[i].z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.Size.x, Config.Size.y, Config.Size.z, Config.Color.r, Config.Color.g, Config.Color.b, 100, false, true, 2, false, false, false, false)
- end
- end
- end
- end
- end)
- -- Enter / Exit marker events
- Citizen.CreateThread(function()
- while true do
- Wait(0)
- local coords = GetEntityCoords(GetPlayerPed(-1))
- local isInMarker = false
- local currentZone = nil
- for k,v in pairs(Config.Zones) do
- for k,v in pairs(Config.Zones) do
- if(GetDistanceBetweenCoords(coords, v[i].x, v[i].y, v[i].z, true) < Config.Size.x) then
- isInMarker = true
- currentZone = k
- LastZone = k
- end
- end
- end
- end
- if isInMarker and not HasAlreadyEnteredMarker then
- HasAlreadyEnteredMarker = true
- TriggerEvent('quest_menu:hasEnteredMarker', currentZone)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement