local QBCore = exports['qb-core']:GetCoreObject() local queued = false local canChop = true local lastChopTime = 0 local chopCooldown = 0 -- Bekleme süresi (saniye cinsinden), 5 dakika local CurrentCops = 0 local PoliceOnDutyRequired = 0 local areaZone = nil local areaBlip = nil local blipOffset = 20 local chopVehicle = 0 local dropOffZone = nil local dropOffBlip = nil local vehMods = { -- You can add more here 0, -- Spoiler 1, -- Front Bumper 2, -- Rear Bumper 3, -- Skirt 4, -- Exhaust 5, -- Chassis 6, -- Grill 7, -- Bonnet 8, -- Wing L 9, -- Wing R 10, -- Roof 22 -- Xenon Lights } local LoadAnimationDict = function(dict) if HasAnimDictLoaded(dict) then return end RequestAnimDict(dict) while not HasAnimDictLoaded(dict) do Wait(0) end end local DrawText3Ds = function(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.015, 0.015+ factor, 0.03, 41, 11, 41, 68) end local IsPlayerNearCoords = function(x, y, z) local playerx, playery, playerz = table.unpack(GetEntityCoords(PlayerPedId(), false)) local dist = Vdist(playerx, playery, playerz, x, y, z) return dist < 1.5 end local props = {} -- To store the spawned props local function SpawnCarPartInHand(partName) local playerPed = PlayerPedId() local boneIndex = GetPedBoneIndex(playerPed, 57005) -- Right Hand Bone local prop = CreateObject(GetHashKey(partName), 0, 0, 0, true, true, true) local xOffset, yOffset, zOffset = 0.1, 0.5, -0.3 local xRot, yRot, zRot = 0.0, 0.0, 90.0 AttachEntityToEntity(prop, playerPed, boneIndex, xOffset, yOffset, zOffset, xRot, yRot, zRot, true, true, false, true, 1, true) return prop end local function CleanupProps() for _, prop in ipairs(props) do if DoesEntityExist(prop) then DeleteObject(prop) end end props = {} end local function DrawMarkerAtLocation(coords) DrawMarker(1, coords.x, coords.y, coords.z - 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0, 255, 0, 100, false, true, 2, false, nil, nil, false) end local prop local propModel = `prop_byard_machine02` local spawnCoords = vector4(-555.19, -1704.35, 18.02, 300.39) CreateThread(function() RequestModel(propModel) while not HasModelLoaded(propModel) do Wait(1) end prop = CreateObject(propModel, spawnCoords.x, spawnCoords.y, spawnCoords.z, false, false, true) SetEntityHeading(prop, spawnCoords.w) FreezeEntityPosition(prop, true) while true do Wait(0) local playerCoords = GetEntityCoords(PlayerPedId()) if #(playerCoords - vector3(spawnCoords.x, spawnCoords.y, spawnCoords.z)) < 1.5 then DrawText3Ds(spawnCoords.x, spawnCoords.y, spawnCoords.z, "Parçanı [~g~E~w~] bas yerlesdir") if IsControlJustReleased(1, 38) then CleanupProps() ClearPedTasks(PlayerPedId()) end end end end) local ChopVehicle = function(veh) local ped = PlayerPedId() TaskLeaveVehicle(ped, veh, 0) FreezeEntityPosition(veh, true) Wait(1500) local chopParts = { { part = 0, bone = 'door_dside_f', text = 'door', prop = "prop_car_door_01" }, { part = 2, bone = 'door_dside_r', text = 'door', condition = function(v) return GetVehicleMaxNumberOfPassengers(v) > 1 end, prop = "prop_car_door_01" }, { part = 3, bone = 'door_pside_r', text = 'door', condition = function(v) return GetVehicleMaxNumberOfPassengers(v) > 1 end, prop = "prop_car_door_01" }, { part = 1, bone = 'door_pside_f', text = 'door', prop = "prop_car_door_01" }, { part = 4, bone = 'bonnet', text = 'hood', prop = "prop_car_bonnet_02" }, { part = 0, bone = 'wheel_lf', text = 'wheel', isWheel = true, prop = "prop_wheel_01" }, { part = 4, bone = 'wheel_lr', text = 'wheel', isWheel = true, prop = "prop_wheel_01" }, { part = 5, bone = 'wheel_rr', text = 'wheel', isWheel = true, prop = "prop_wheel_01" }, { part = 1, bone = 'wheel_rf', text = 'wheel', isWheel = true, prop = "prop_wheel_01" } } for _, partInfo in ipairs(chopParts) do if not partInfo.condition or partInfo.condition(veh) then local coords = GetWorldPositionOfEntityBone(veh, GetEntityBoneIndexByName(veh, partInfo.bone)) while true do Wait(0) DrawText3Ds(coords.x, coords.y, coords.z, "[~g~E~w~] Bas ve Sök ".. partInfo.text) if IsPlayerNearCoords(coords.x, coords.y, coords.z) and IsControlJustReleased(1, 38) then break end end SetVehicleDoorOpen(veh, partInfo.part, false, false) TaskStartScenarioInPlace(ped, 'WORLD_HUMAN_WELDING', 0, true) Wait(10000) -- Wait for welding animation to complete ClearPedTasksImmediately(ped) table.insert(props, prop) if partInfo.isWheel then SetVehicleTyreBurst(veh, partInfo.part, true, 1000.0) else SetVehicleDoorBroken(veh, partInfo.part, true) end TriggerServerEvent('caticus-chopshop:server:Reward', partInfo.text:gsub(" ", "_"):lower()) end end TriggerEvent('QBCore:Notify', 'Parçalama işlemini bitirdin.', 'success') TriggerEvent("tgiann-policeAlert:alert", "Araç Parçalama Şüphesi", false) chopVehicle = 0 Wait(4000) NetworkFadeOutEntity(veh, true, false) Wait(2000) local netId = NetworkGetNetworkIdFromEntity(veh) TriggerServerEvent("caticus-chopshop:server:DeleteVehicle", netId) if Shared.ak4yBlack then TriggerServerEvent('alizadev-blackm:taskCountAdd', 4, 1) end end local CreateAreaBlip = function(coords) local offsetSign = math.random(-100, 100) / 100 local blip = AddBlipForRadius(coords.x + (offsetSign * blipOffset), coords.y + (offsetSign * blipOffset), coords.z + (offsetSign * blipOffset), 250.00) SetBlipHighDetail(blip, true) SetBlipAlpha(blip, 100) SetBlipColour(blip, 2) return blip end local CreateDropOffBlip = function(coords) local blip = AddBlipForCoord(coords.x, coords.y, coords.z) SetBlipSprite(blip, 227) SetBlipColour(blip, 2) SetBlipScale(blip, 0.80) AddTextEntry('MYBLIP', "Dropoff Location") BeginTextCommandSetBlipName('MYBLIP') AddTextComponentSubstringPlayerName('Vehicle Drop off') EndTextCommandSetBlipName(blip) return blip end local SetRandomCosmetics = function(vehicle) local c1, c2 = math.random(160), math.random(160) SetVehicleColours(vehicle, c1, c2) SetVehicleModKit(vehicle, 0) for i = 1, #vehMods, 1 do local modAmount = GetNumVehicleMods(vehicle, vehMods[i]) local rndm = math.random(modAmount) SetVehicleMod(vehicle, vehMods[i], rndm, false) end end local EnableUpgrades = function(vehicle) SetVehicleModKit(vehicle, 0) ToggleVehicleMod(vehicle, 18, true) -- Turbo SetVehicleMod(vehicle, 11, 2, false) -- Engine SetVehicleMod(vehicle, 12, 1, false) -- Brakes SetVehicleMod(vehicle, 13, 1, false) -- Transmission end local ReceiveMission = function() SetTimeout(math.random(100, 200), function() local charinfo = QBCore.Functions.GetPlayerData().charinfo local model = Shared.Vehicles[math.random(#Shared.Vehicles)] QBCore.Functions.TriggerCallback('caticus-chopshop:server:GetPlate', function(result) local plate = result TriggerEvent('caticus-chopshop:client:AcceptMission', { model = model, plate = plate }) end) end) end RegisterNetEvent('caticus-chopshop:client:AcceptMission', function(data) if CurrentCops >= PoliceOnDutyRequired then local model = data.model local plate = data.plate TriggerEvent('QBCore:Notify', 'Araç haritada işaretlendi onu bul ve parçala', 'success') local randLoc = math.random(#Shared.Locations) local vehLoc = Shared.Locations[randLoc] areaBlip = CreateAreaBlip(vehLoc) areaZone = CircleZone:Create(vehLoc, 200.00, { name = "chopshop_veharea", debugPoly = false }) areaZone:onPlayerInOut(function(isPointInside, point) if isPointInside then QBCore.Functions.TriggerCallback('caticus-chopshop:server:SpawnVehicle', function(netId) while not NetworkDoesEntityExistWithNetworkId(netId) do Wait(10) end chopVehicle = NetworkGetEntityFromNetworkId(netId) SetRandomCosmetics(chopVehicle) EnableUpgrades(chopVehicle) SetVehicleDoorsLocked(chopVehicle, 1) end, model, vehLoc, plate) areaZone:destroy() TriggerEvent('QBCore:Notify', 'Aranan aracı bul ve çal.', 'success') end end) local madeDropOffZone = false while not madeDropOffZone do Wait(3000) local veh = GetVehiclePedIsIn(PlayerPedId(), false) if GetVehicleNumberPlateText(veh) == plate then chopVehicle = veh RemoveBlip(areaBlip) madeDropOffZone = true end end local dropOffLoc = Shared.DropOffLocations[math.random(#Shared.DropOffLocations)] SetNewWaypoint(dropOffLoc.x, dropOffLoc.y) TriggerEvent('QBCore:Notify', 'Parçalama noktasına git', 'success') dropOffBlip = CreateDropOffBlip(dropOffLoc) dropOffZone = CircleZone:Create(dropOffLoc, 4.0, { name = "chopshop_dropOffArea", debugPoly = false }) local inZone = false dropOffZone:onPlayerInOut(function(isPointInside, point) local veh = GetVehiclePedIsIn(PlayerPedId(), false) if isPointInside then inZone = true if chopVehicle == veh then exports['qb-core']:DrawText('[E] - Aracı Parçala', 'left') CreateThread(function() while inZone and chopVehicle == veh do if IsControlJustPressed(0, 38) then exports['qb-core']:HideText() TriggerEvent('QBCore:Notify', 'Aracı parçalamaya başlayın.', 'success') dropOffZone:destroy() RemoveBlip(dropOffBlip) ChopVehicle(chopVehicle) return end Wait(3) end end) end else inZone = false exports['qb-core']:HideText() end end) else QBCore.Functions.Notify("Yetəri qədər polis yoxdur", 'error', 3500) end end) RegisterNetEvent('police:SetCopCount', function(amount) CurrentCops = amount end) RegisterNetEvent('caticus-chopshop:client:StartChopShop', function() if not canChop then local remainingTime = chopCooldown - (GetGameTimer() - lastChopTime) / 1000 TriggerEvent('QBCore:Notify', 'Araç parçalama işlemi için ' .. math.ceil(remainingTime) .. ' saniye beklemelisin.', 'error') return end queued = not queued if queued then CreateThread(function() if not queued then return end ReceiveMission() queued = false lastChopTime = GetGameTimer() canChop = false Citizen.Wait(chopCooldown * 1000) canChop = true end) end end) local pedCreated = false CreateThread(function() if not pedCreated then exports['qb-target']:SpawnPed({ model = `a_m_y_busicas_01`, coords = vector4(-538.53, -1718.98, 19.25, 333.16), minusOne = true, freeze = true, invincible = true, blockevents = true, scenario = '', target = { options = { { type = "client", event = "caticus-chopshop:client:StartChopShop", icon = 'fas fa-user-secret', label = 'Araç Parçalamaya Başla' } }, distance = 1.5 }, }) pedCreated = true end end)