function VehiclePartsRemoval()
local ped = PlayerPedId()
local vehicle = GetVehiclePedIsIn( ped, false )
local rearLeftDoor = GetEntityBoneIndexByName(GetVehiclePedIsIn(GetPlayerPed(-1), false), 'door_dside_r')
local bonnet = GetEntityBoneIndexByName(GetVehiclePedIsIn(GetPlayerPed(-1), false), 'bonnet')
local boot = GetEntityBoneIndexByName(GetVehiclePedIsIn(GetPlayerPed(-1), false), 'boot')
local vehicleData = ESX.Game.GetVehicleProperties(vehicle)
SetVehicleEngineOn(vehicle, false, false, true)
SetVehicleUndriveable(vehicle, false)
if ChoppingInProgress == true then
exports['progressBars']:startUI(2500, "Ön sol kapı açılıyor")
Citizen.Wait(2500)
SetVehicleDoorOpen(GetVehiclePedIsIn(ped, false), 0, false, false)
end
Citizen.Wait(1000)
if ChoppingInProgress == true then
exports['progressBars']:startUI(12000, "Ön sol kapı parçalanıyor")
Citizen.Wait(12000)
SetVehicleDoorBroken(GetVehiclePedIsIn(ped, false), 0, true)
end
Citizen.Wait(1000)
if ChoppingInProgress == true then
exports['progressBars']:startUI(2500, "Ön Sağ Kapı Açılıyor")
Citizen.Wait(2500)
SetVehicleDoorOpen(GetVehiclePedIsIn(ped, false), 1, false, false)
end
Citizen.Wait(1000)
if ChoppingInProgress == true then
exports['progressBars']:startUI(12000, "Ön Sağ Kapı Parçalanıyor")
Citizen.Wait(12000)
SetVehicleDoorBroken(GetVehiclePedIsIn(ped, false), 1, true)
end
Citizen.Wait(1000)
if rearLeftDoor ~= -1 then
if ChoppingInProgress == true then
exports['progressBars']:startUI(2500, "Arka Sol Kapı Açılıyor")
Citizen.Wait(2500)
SetVehicleDoorOpen(GetVehiclePedIsIn(ped, false), 2, false, false)
end
Citizen.Wait(1000)
if ChoppingInProgress == true then
exports['progressBars']:startUI(12000, "Arka Sol Kapı Parçalanıyor")
Citizen.Wait(12000)
SetVehicleDoorBroken(GetVehiclePedIsIn(ped, false), 2, true)
end
Citizen.Wait(1000)
if ChoppingInProgress == true then
exports['progressBars']:startUI(2500, "Arka Sağ Kapı Açılıyor")
Citizen.Wait(2500)
SetVehicleDoorOpen(GetVehiclePedIsIn(ped, false), 3, false, false)
end
Citizen.Wait(1000)
if ChoppingInProgress == true then
exports['progressBars']:startUI(12000, "Arka Sağ Kapı Parçalanıyor")
Citizen.Wait(12000)
SetVehicleDoorBroken(GetVehiclePedIsIn(ped, false), 3, true)
end
end
Citizen.Wait(1000)
if bonnet ~= -1 then
if ChoppingInProgress == true then
exports['progressBars']:startUI(2500, "Kaput Açılıyor")
Citizen.Wait(2500)
SetVehicleDoorOpen(GetVehiclePedIsIn(ped, false), 4, false, false)
end
Citizen.Wait(1000)
if ChoppingInProgress == true then
exports['progressBars']:startUI(12000, "Kaput Parçalanıyor")
Citizen.Wait(12000)
SetVehicleDoorBroken(GetVehiclePedIsIn(ped, false),4, true)
end
end
Citizen.Wait(1000)
if boot ~= -1 then
if ChoppingInProgress == true then
exports['progressBars']:startUI(2500, "Bagaj Açılıyor")
Citizen.Wait(2500)
SetVehicleDoorOpen(GetVehiclePedIsIn(ped, false), 5, false, false)
end
Citizen.Wait(1000)
if ChoppingInProgress == true then
exports['progressBars']:startUI(12000, "Bagaj Parçalanıyor")
Citizen.Wait(12000)
SetVehicleDoorBroken(GetVehiclePedIsIn(ped, false),5, true)
end
end
Citizen.Wait(1000)
exports['progressBars']:startUI(20000, "Araç Yer yüzünden siliniyor :(")
Citizen.Wait(20000)
if ChoppingInProgress == true then
local vehicle = GetVehiclePedIsIn( ped, false )
if vehicle then
local vehPlate = GetVehicleNumberPlateText(vehicle)
ESX.TriggerServerCallback('Lenzh_chopshop:OwnedCar', function(owner)
if owner then
ESX.ShowNotification("Aracın Başarıyla Parçalandı...", false, true, g)
DeleteVehicle(vehicle)
else
ESX.ShowNotification("Araç Başarıyla Parçalandı...", false, true, g)
DeleteVehicle(vehicle)
end
end, vehPlate)
end
TriggerServerEvent("Lenzh_chopshop:ChopRewards")
TriggerServerEvent('rgs-yoket', vehicleData.plate)
end
end