Help remove any specific vehicle in map without blacklist script

thankyou verymuch for the link… :slight_smile:

anyway can you help me with my script bellow :slight_smile:

Citizen.CreateThread(function()
while true do
Citizen.Wait(1)

local cmodel = GetHashKey("cargoplane")
 local coords = GetOffsetFromEntityInWorldCoords(GetPlayerPed(-1), offsetX, offsetY, offsetZ)
local vehcp = GetEntityModel(cmodel, coords, 0.0, true, false)
local id = NetworkGetNetworkIdFromEntity(vehcp)
if DoesEntityExist(vehcp) and IsControlJustPressed(1, 232) then
    SetEntityIAsMissionEntity(vehcp, 1, 1)
    DeleteVehicle(vehcp)
    Citizen.InvokeNative(0xEA386986E786A54F, Citizen.PointerValueIntInitialized(vehcp))
end

end

end)

can u help me to fix this script to get this script worked when press w button any cargoplane at any where in map should be removed or deleted… ?