local QBCore = exports['qb-core']:GetCoreObject() local tasking = false local drugStorePed = 0 local oxyVehicle = 0 local OxyDropOffs = { [1] = { ['x'] = 483.17,['y'] = -1827.35,['z'] = 27.86,['h'] = 135.87, ['info'] = ' East Side 1' }, [2] = { ['x'] = 475.87,['y'] = -1798.45,['z'] = 28.49,['h'] = 229.85, ['info'] = ' East Side 2' }, -- [3] = { ['x'] = 503.54,['y'] = -1765.06,['z'] = 28.51,['h'] = 67.61, ['info'] = ' East Side 3' }, -- [4] = { ['x'] = 512.0,['y'] = -1842.13,['z'] = 27.9,['h'] = 138.1, ['info'] = ' East Side 4' }, -- [5] = { ['x'] = 466.89,['y'] = -1852.81,['z'] = 27.72,['h'] = 310.97, ['info'] = ' East Side 5' }, -- [6] = { ['x'] = 431.33,['y'] = -1882.85,['z'] = 26.85,['h'] = 39.7, ['info'] = ' East Side 6' }, -- [7] = { ['x'] = 410.64,['y'] = -1908.57,['z'] = 25.46,['h'] = 80.03, ['info'] = ' East Side 7' }, -- [8] = { ['x'] = 192.93,['y'] = -2027.95,['z'] = 18.29,['h'] = 251.25, ['info'] = ' East Side 8' }, -- [9] = { ['x'] = 184.05,['y'] = -2004.77,['z'] = 18.31,['h'] = 49.81, ['info'] = ' East Side 9' }, -- [10] = { ['x'] = 212.4,['y'] = -1971.66,['z'] = 20.31,['h'] = 63.83, ['info'] = ' East Side 10' }, -- [11] = { ['x'] = 266.85,['y'] = -1964.41,['z'] = 23.0,['h'] = 49.59, ['info'] = ' East Side 11' }, -- [12] = { ['x'] = 313.05,['y'] = -1918.57,['z'] = 25.65,['h'] = 315.88, ['info'] = ' East Side 12' }, -- [13] = { ['x'] = 282.63,['y'] = -1948.96,['z'] = 24.39,['h'] = 40.21, ['info'] = ' East Side 13' }, -- [14] = { ['x'] = 250.44,['y'] = -1995.9,['z'] = 20.32,['h'] = 324.5, ['info'] = ' East Side 14' }, -- [15] = { ['x'] = 270.54,['y'] = -1706.13,['z'] = 29.31,['h'] = 46.82, ['info'] = ' Central 1' }, -- [16] = { ['x'] = 167.78,['y'] = -1635.0,['z'] = 29.3,['h'] = 22.04, ['info'] = ' Central 2' }, -- [17] = { ['x'] = 175.98,['y'] = -1542.48,['z'] = 29.27,['h'] = 316.21, ['info'] = ' Central 3' }, -- [18] = { ['x'] = -99.69,['y'] = -1577.74,['z'] = 31.73,['h'] = 231.66, ['info'] = ' Central 4' }, -- [19] = { ['x'] = -171.68,['y'] = -1659.11,['z'] = 33.47,['h'] = 85.41, ['info'] = ' Central 5' }, -- [20] = { ['x'] = -209.75,['y'] = -1632.29,['z'] = 33.9,['h'] = 177.99, ['info'] = ' Central 6' }, -- [21] = { ['x'] = -262.65,['y'] = -1580.04,['z'] = 31.86,['h'] = 251.02, ['info'] = ' Central 7' }, -- [22] = { ['x'] = -182.0,['y'] = -1433.79,['z'] = 31.31,['h'] = 210.92, ['info'] = ' Central 8' }, -- [23] = { ['x'] = -83.37,['y'] = -1415.39,['z'] = 29.33,['h'] = 180.98, ['info'] = ' Central 9' }, -- [24] = { ['x'] = -39.13,['y'] = -1473.67,['z'] = 31.65,['h'] = 5.17, ['info'] = ' Central 10' }, -- [25] = { ['x'] = 45.16,['y'] = -1475.65,['z'] = 29.36,['h'] = 136.92, ['info'] = ' Central 11' }, -- [26] = { ['x'] = 158.52,['y'] = -1496.02,['z'] = 29.27,['h'] = 133.49, ['info'] = ' Central 12' }, -- [27] = { ['x'] = 43.58,['y'] = -1599.87,['z'] = 29.61,['h'] = 50.3, ['info'] = ' Central 13' }, -- [28] = { ['x'] = 7.97,['y'] = -1662.14,['z'] = 29.33,['h'] = 318.63, ['info'] = ' Central 14' }, -- [29] = { ['x'] = -726.92,['y'] = -854.64,['z'] = 22.8,['h'] = 2.0, ['info'] = ' West 1' }, -- [30] = { ['x'] = -713.09,['y'] = -886.66,['z'] = 23.81,['h'] = 357.65, ['info'] = ' West 2' }, -- [31] = { ['x'] = -591.45,['y'] = -891.2,['z'] = 25.95,['h'] = 91.53, ['info'] = ' West 3' }, -- [32] = { ['x'] = -683.59,['y'] = -945.62,['z'] = 20.85,['h'] = 180.74, ['info'] = ' West 4' }, -- [33] = { ['x'] = -765.92,['y'] = -920.94,['z'] = 18.94,['h'] = 180.44, ['info'] = ' West 5' }, -- [34] = { ['x'] = -807.45,['y'] = -957.09,['z'] = 15.29,['h'] = 340.4, ['info'] = ' West 6' }, -- [35] = { ['x'] = -822.88,['y'] = -973.96,['z'] = 14.72,['h'] = 126.28, ['info'] = ' West 7' }, -- [36] = { ['x'] = -657.53,['y'] = -729.91,['z'] = 27.84,['h'] = 309.58, ['info'] = ' West 8' }, -- [37] = { ['x'] = -618.39,['y'] = -750.71,['z'] = 26.66,['h'] = 85.6, ['info'] = ' West 9' }, -- [38] = { ['x'] = -548.36,['y'] = -854.53,['z'] = 28.82,['h'] = 352.84, ['info'] = ' West 10' }, -- [39] = { ['x'] = -518.18,['y'] = -804.65,['z'] = 30.8,['h'] = 267.32, ['info'] = ' West 11' }, -- [40] = { ['x'] = -509.05,['y'] = -737.77,['z'] = 32.6,['h'] = 174.97, ['info'] = ' West 12' }, -- [41] = { ['x'] = -654.89,['y'] = -732.13,['z'] = 27.56,['h'] = 309.15, ['info'] = ' West 14' }, } --[[local OxyDropOffs = { [1] = { ['x'] = 74.5,['y'] = -762.17,['z'] = 31.68,['h'] = 160.98, ['info'] = ' 1' }, [2] = { ['x'] = 100.58,['y'] = -644.11,['z'] = 44.23,['h'] = 69.11, ['info'] = ' 2' }, [3] = { ['x'] = 175.45,['y'] = -445.95,['z'] = 41.1,['h'] = 92.72, ['info'] = ' 3' }, [4] = { ['x'] = 130.3,['y'] = -246.26,['z'] = 51.45,['h'] = 219.63, ['info'] = ' 4' }, [5] = { ['x'] = 198.1,['y'] = -162.11,['z'] = 56.35,['h'] = 340.09, ['info'] = ' 5' }, [6] = { ['x'] = 341.0,['y'] = -184.71,['z'] = 58.07,['h'] = 159.33, ['info'] = ' 6' }, [7] = { ['x'] = -26.96,['y'] = -368.45,['z'] = 39.69,['h'] = 251.12, ['info'] = ' 7' }, [8] = { ['x'] = -155.88,['y'] = -751.76,['z'] = 33.76,['h'] = 251.82, ['info'] = ' 8' }, [9] = { ['x'] = -305.02,['y'] = -226.17,['z'] = 36.29,['h'] = 306.04, ['info'] = ' chewy1' }, [10] = { ['x'] = -347.19,['y'] = -791.04,['z'] = 33.97,['h'] = 3.06, ['info'] = ' biscuts2' }, [11] = { ['x'] = -703.75,['y'] = -932.93,['z'] = 19.22,['h'] = 87.86, ['info'] = ' are3' }, [12] = { ['x'] = -659.35,['y'] = -256.83,['z'] = 36.23,['h'] = 118.92, ['info'] = ' only4' }, [13] = { ['x'] = -934.18,['y'] = -124.28,['z'] = 37.77,['h'] = 205.79, ['info'] = ' nice5' }, [14] = { ['x'] = -1214.3,['y'] = -317.57,['z'] = 37.75,['h'] = 18.39, ['info'] = ' ifthey6' }, [15] = { ['x'] = -822.83,['y'] = -636.97,['z'] = 27.9,['h'] = 160.23, ['info'] = ' contain7' }, [16] = { ['x'] = 308.04,['y'] = -1386.09,['z'] = 31.79,['h'] = 47.23, ['info'] = ' chocolate' }, }]]-- local carspawns = { [1] = { ['x'] = -579.0936, ['y'] = -1795.169, ['z'] = 22.808954, ['h'] = 142.6574, ['info'] = ' car 1' }, [2] = { ['x'] = -582.2067, ['y'] = -1791.333, ['z'] = 22.780055, ['h'] = 136.15734, ['info'] = ' car 2' }, [3] = { ['x'] = -585.9086, ['y'] = -1796.614, ['z'] = 22.938987, ['h'] = 144.92637, ['info'] = ' car 3' }, [4] = { ['x'] = -583.7136, ['y'] = -1800.105, ['z'] = 23.009094, ['h'] = 150.41642, ['info'] = ' car 4' }, [5] = { ['x'] = -593.0315, ['y'] = -1798.594, ['z'] = 23.149597, ['h'] = 156.49855, ['info'] = ' car 5' }, [6] = { ['x'] = -601.677, ['y'] = -1795.731, ['z'] = 23.424543, ['h'] = 165.81521, ['info'] = ' car 6' }, [7] = { ['x'] = -607.984, ['y'] = -1793.033, ['z'] = 23.573696, ['h'] = 165.08354, ['info'] = ' car 7' }, [8] = { ['x'] = -598.3325, ['y'] = -1793.086, ['z'] = 23.462425, ['h'] = 123.32141, ['info'] = ' car 8' }, } local pillStore = { ['x'] = -582.91,['y'] = -1767.334,['z'] = 23.180343,['h'] = 317.41, ['info'] = ' oxy' } local pillWorker = { ['x'] = -583.57,['y'] = -1763.64,['z'] = -3.01086,['h'] = 176.47 , ['info'] = 'boop bap' } local rnd = 0 local blip = 0 local deliveryPed = 0 local oxyPeds = { 'a_m_y_stwhi_02', 'a_m_y_stwhi_01' } local carpick = { [1] = "felon", [2] = "sultan", [3] = "granger", [4] = "tailgater", } function buildDrugShop() DoScreenFadeOut(1000) Citizen.Wait(1000) SetEntityCoords(PlayerPedId(),-583.8415, -1771.879, -3.01086) -- Default FreezeEntityPosition(PlayerPedId(),true) local generator = { x = pillStore["x"] , y = pillStore["y"], z = pillStore["z"] - 35.0} SetEntityCoords(PlayerPedId(),generator.x,generator.y,generator.z+2) local building = CreateObject(`traphouse_shell`,generator.x-0.31811000,generator.y+1.79183500,generator.z+2.56171400,false,false,false) FreezeEntityPosition(building, true) local coordsofbuilding = GetEntityCoords(building, true) SetEntityCoords(PlayerPedId(), -583.74, -1771.91, -3.01) Citizen.Wait(500) SetEntityHeading(PlayerPedId(),0.0) FreezeEntityPosition(PlayerPedId(),false) DoScreenFadeIn(1) end function CreateDrugStorePed() if DoesEntityExist(drugStorePed) then return end local hashKey = `a_m_y_stwhi_02` local pedType = GetPedType(hashKey) RequestModel(hashKey) while not HasModelLoaded(hashKey) do Citizen.Wait(250) end drugStorePed = CreatePed(pedType, hashKey, pillWorker["x"],pillWorker["y"],pillWorker["z"], 270.0, 1, 1) SetEntityHeading(drugStorePed, 176.90) ClearPedTasks(drugStorePed) ClearPedSecondaryTask(drugStorePed) TaskSetBlockingOfNonTemporaryEvents(drugStorePed, true) SetPedFleeAttributes(drugStorePed, 0, 0) SetPedCombatAttributes(drugStorePed, 17, 1) SetPedSeeingRange(drugStorePed, 0.0) SetPedHearingRange(drugStorePed, 0.0) SetPedAlertness(drugStorePed, 0) SetPedKeepTask(drugStorePed, true) end function CreateOxyVehicle() if DoesEntityExist(oxyVehicle) then SetVehicleHasBeenOwnedByPlayer(oxyVehicle,false) SetEntityAsNoLongerNeeded(oxyVehicle) DeleteEntity(oxyVehicle) end local car = GetHashKey(carpick[math.random(#carpick)]) RequestModel(car) while not HasModelLoaded(car) do Citizen.Wait(0) end local spawnpoint = 1 for i = 1, #carspawns do local caisseo = GetClosestVehicle(carspawns[i]["x"], carspawns[i]["y"], carspawns[i]["z"], 3.500, 0, 70) if not DoesEntityExist(caisseo) then spawnpoint = i end end oxyVehicle = CreateVehicle(car, carspawns[spawnpoint]["x"], carspawns[spawnpoint]["y"], carspawns[spawnpoint]["z"], carspawns[spawnpoint]["h"], true, false) local plt = GetVehicleNumberPlateText(oxyVehicle) SetVehicleHasBeenOwnedByPlayer(oxyVehicle,true) local plate = GetVehicleNumberPlateText(oxyVehicle) TriggerEvent("vehiclekeys:client:SetOwner", GetVehicleNumberPlateText(oxyVehicle), oxyVehicle) while true do Citizen.Wait(1) DrawText3Ds(carspawns[spawnpoint]["x"], carspawns[spawnpoint]["y"], carspawns[spawnpoint]["z"], "Your Delivery Car (Stolen).") if #(GetEntityCoords(PlayerPedId()) - vector3(carspawns[spawnpoint]["x"], carspawns[spawnpoint]["y"], carspawns[spawnpoint]["z"])) < 8.0 then return end end end function CreateOxyPed() local hashKey = `g_m_y_salvagoon_01` local pedType = 5 RequestModel(hashKey) while not HasModelLoaded(hashKey) do RequestModel(hashKey) Citizen.Wait(100) end deliveryPed = CreatePed(pedType, hashKey, OxyDropOffs[rnd]["x"],OxyDropOffs[rnd]["y"],OxyDropOffs[rnd]["z"], OxyDropOffs[rnd]["h"], 0, 0) ClearPedTasks(deliveryPed) ClearPedSecondaryTask(deliveryPed) TaskSetBlockingOfNonTemporaryEvents(deliveryPed, true) SetPedFleeAttributes(deliveryPed, 0, 0) SetPedCombatAttributes(deliveryPed, 17, 1) SetPedSeeingRange(deliveryPed, 0.0) SetPedHearingRange(deliveryPed, 0.0) SetPedAlertness(deliveryPed, 0) searchPockets() SetPedKeepTask(deliveryPed, true) end function DeleteCreatedPed() if DoesEntityExist(deliveryPed) then SetPedKeepTask(deliveryPed, false) TaskSetBlockingOfNonTemporaryEvents(deliveryPed, false) ClearPedTasks(deliveryPed) TaskWanderStandard(deliveryPed, 10.0, 10) SetPedAsNoLongerNeeded(deliveryPed) Citizen.Wait(20000) DeletePed(deliveryPed) end end function DeleteBlip() if DoesBlipExist(blip) then RemoveBlip(blip) end end function CreateBlip() DeleteBlip() if OxyRun then blip = AddBlipForCoord(OxyDropOffs[rnd]["x"],OxyDropOffs[rnd]["y"],OxyDropOffs[rnd]["z"]) end SetBlipSprite(blip, 514) SetBlipScale(blip, 1.0) SetBlipAsShortRange(blip, false) BeginTextCommandSetBlipName("STRING") AddTextComponentString("Drop Off") EndTextCommandSetBlipName(blip) end function loadAnimDict(dict) while (not HasAnimDictLoaded(dict)) do RequestAnimDict(dict) Citizen.Wait(5) end end function searchPockets() if (DoesEntityExist(deliveryPed) and not IsEntityDead(deliveryPed)) then loadAnimDict("random@mugging4" ) TaskPlayAnim(deliveryPed, "random@mugging4", "agitated_loop_a", 8.0, 1.0, -1, 16, 0, 0, 0, 0) end end function playerAnim() loadAnimDict("mp_safehouselost@") TaskPlayAnim(PlayerPedId(), "mp_safehouselost@", "package_dropoff", 8.0, 1.0, -1, 16, 0, 0, 0, 0) end function giveAnim() if (DoesEntityExist(deliveryPed) and not IsEntityDead(deliveryPed)) then loadAnimDict("mp_safehouselost@") if (IsEntityPlayingAnim(deliveryPed, "mp_safehouselost@", "package_dropoff", 3)) then TaskPlayAnim(deliveryPed, "mp_safehouselost@", "package_dropoff", 8.0, 1.0, -1, 16, 0, 0, 0, 0) else TaskPlayAnim(deliveryPed, "mp_safehouselost@", "package_dropoff", 8.0, 1.0, -1, 16, 0, 0, 0, 0) end end end function DoDropOff() local success = true local OxyChance = math.random(1,1000) local part = math.random(1, 100) searchPockets() Citizen.Wait(1000) playerAnim() TriggerEvent("attachItemDrugs","cashcase01") Citizen.Wait(800) PlayAmbientSpeech1(deliveryPed, "Chat_State", "Speech_Params_Force") if DoesEntityExist(deliveryPed) and not IsEntityDead(deliveryPed) then local counter = math.random(50,200) while counter > 0 do local crds = GetEntityCoords(deliveryPed) counter = counter - 1 Citizen.Wait(1) end if success then local counter = math.random(100,300) while counter > 0 do local crds = GetEntityCoords(deliveryPed) counter = counter - 1 Citizen.Wait(1) end giveAnim() TriggerEvent("destroyProp") end local crds = GetEntityCoords(deliveryPed) local crds2 = GetEntityCoords(PlayerPedId()) if #(crds - crds2) > 3.0 or not DoesEntityExist(deliveryPed) or IsEntityDead(deliveryPed) then success = false end DeleteBlip() if success then if OxyChance <= Config.OxyChance then TriggerServerEvent("oxydelivery:receiveoxy") elseif part >= 75 then -- chance TriggerServerEvent("oxydelivery:receiveBigRewarditem") else TriggerServerEvent("oxydelivery:receiveoxy") if math.random(1, 100) >= 80 then TriggerServerEvent('QBCore:Server:AddItem', "advancedlockpick", 1) end end Citizen.Wait(2000) QBCore.Functions.Notify('I got the call in, delivery was on point, go await the next one!', 'error') else QBCore.Functions.Notify('The drop off failed.', 'error') end DeleteCreatedPed() end end function DrawText3Ds(x,y,z, text) local onScreen,_x,_y=World3dToScreen2d(x,y,z) local px,py,pz=table.unpack(GetGameplayCamCoords()) SetTextScale(0.35, 0.35) SetTextFont(4) SetTextProportional(1) SetTextColour(255, 255, 255, 215) SetTextEntry("STRING") SetTextCentre(1) AddTextComponentString(text) DrawText(_x,_y) local factor = (string.len(text)) / 370 DrawRect(_x,_y+0.0125, 0.015+ factor, 0.03, 41, 11, 41, 68) end RegisterNetEvent("oxydelivery:client") AddEventHandler("oxydelivery:client", function() if tasking then return end rnd = math.random(1,#OxyDropOffs) CreateBlip() local pedCreated = false tasking = true local toolong = 600000 while tasking do Citizen.Wait(1) local plycoords = GetEntityCoords(PlayerPedId()) local dstcheck = #(plycoords - vector3(OxyDropOffs[rnd]["x"],OxyDropOffs[rnd]["y"],OxyDropOffs[rnd]["z"])) local oxyVehCoords = GetEntityCoords(oxyVehicle) local dstcheck2 = #(plycoords - oxyVehCoords) local veh = GetVehiclePedIsIn(PlayerPedId(),false) if dstcheck < 40.0 and not pedCreated and (oxyVehicle == veh or dstcheck2 < 15.0) then pedCreated = true DeleteCreatedPed() CreateOxyPed() QBCore.Functions.Notify('You are close to the drop off.') end toolong = toolong - 1 if toolong < 0 then SetVehicleHasBeenOwnedByPlayer(oxyVehicle,false) SetEntityAsNoLongerNeeded(oxyVehicle) tasking = false OxyRun = false QBCore.Functions.Notify('You are no longer selling Oxy due to taking too long to drop off.') end if dstcheck < 2.0 and pedCreated then local crds = GetEntityCoords(deliveryPed) DrawText3Ds(crds["x"],crds["y"],crds["z"], "[E]") if not IsPedInAnyVehicle(PlayerPedId()) and IsControlJustReleased(0,38) then TaskTurnPedToFaceEntity(deliveryPed, PlayerPedId(), 1.0) Citizen.Wait(1500) PlayAmbientSpeech1(deliveryPed, "Generic_Hi", "Speech_Params_Force") DoDropOff() tasking = false end end end DeleteCreatedPed() DeleteBlip() end) local cooldown = true Citizen.CreateThread(function() while true do Citizen.Wait(1) local dropOff4 = #(GetEntityCoords(PlayerPedId()) - vector3(-583.74, -1771.90, -3.01)) local dropOff5 = #(GetEntityCoords(PlayerPedId()) - vector3(pillStore["x"],pillStore["y"],pillStore["z"])) local dropOff6 = #(GetEntityCoords(PlayerPedId()) - vector3(pillWorker["x"],pillWorker["y"],pillWorker["z"])) if dropOff4 < 1.2 then DrawText3Ds(-583.74, -1771.91, -3.01, "[E] to Leave") if IsControlJustReleased(0,38) then CleanUpArea() SetEntityCoords(PlayerPedId(),pillStore["x"],pillStore["y"],pillStore["z"]) Citizen.Wait(1000) TriggerEvent('cr-weathersync:client:EnableSync') end end if dropOff5 < 1.2 then DrawText3Ds(pillStore["x"],pillStore["y"],pillStore["z"], "[E] to Enter") if IsControlJustReleased(0,38) then buildDrugShop() CreateDrugStorePed() SetRainFxIntensity(0.0) TriggerEvent('cr-weathersync:client:DisableSync') Citizen.Wait(100) SetWeatherTypePersist('EXTRASUNNY') SetWeatherTypeNow('EXTRASUNNY') SetWeatherTypeNowPersist('EXTRASUNNY') NetworkOverrideClockTime(22, 0, 0) end elseif dropOff5 > 100 then Wait(2500) end if dropOff6 < 1.6 and not OxyRun then DrawText3Ds(pillWorker["x"],pillWorker["y"],pillWorker["z"], "[E] $1500 - Delivery Job (Payment Cash + Oxy)") --if cooldown then if IsControlJustReleased(0,38) then TriggerServerEvent("oxydelivery:server") Citizen.Wait(1000) --cooldown = false --Wait(3600000) --cooldown = true end --else --QBCore.Functions.Notify('You have to wait before starting runs again.', 'error') --end]]-- end end end) local firstdeal = false Citizen.CreateThread(function() while true do if OxyRun then if not DoesEntityExist(oxyVehicle) or GetVehicleEngineHealth(oxyVehicle) < 200.0 or GetVehicleBodyHealth(oxyVehicle) < 200.0 then OxyRun = false tasking = false QBCore.Functions.Notify('The dealer isnt giving you anymore locations due to the state of his car.', 'error') else if tasking then Citizen.Wait(30000) else TriggerEvent("oxydelivery:client") salecount = salecount + 1 if salecount == Config.RunAmount then Citizen.Wait(1200000) OxyRun = false QBCore.Functions.Notify('You finished delivering all your shit, you can start doing deliveries again.', 'error') end end end else if not close then Citizen.Wait(2000) end end end end) RegisterNetEvent("oxydelivery:startDealing") AddEventHandler("oxydelivery:startDealing", function() local NearNPC = GetClosestPed() PlayAmbientSpeech1(NearNPC, "Chat_Resp", "SPEECH_PARAMS_FORCE", 1) QBCore.Functions.Notify('Your pager will be updated with locations soon.') exports['qb-dispatch']:DrugSale() salecount = 0 OxyRun = true firstdeal = true CreateOxyVehicle() end) function CleanUpArea() local playerped = PlayerPedId() local plycoords = GetEntityCoords(playerped) local handle, ObjectFound = FindFirstObject() local success repeat local pos = GetEntityCoords(ObjectFound) local distance = #(plycoords - pos) if distance < 10.0 and ObjectFound ~= playerped then if IsEntityAPed(ObjectFound) then if IsPedAPlayer(ObjectFound) then else DeleteObject(ObjectFound) end else if not IsEntityAVehicle(ObjectFound) and not IsEntityAttached(ObjectFound) then DeleteObject(ObjectFound) end end end success, ObjectFound = FindNextObject(handle) until not success SetEntityAsNoLongerNeeded(drugStorePed) DeleteEntity(drugStorePed) EndFindObject(handle) end