check for destroyProp if received any info

This commit is contained in:
Jim Shield
2024-01-19 13:02:09 +00:00
committed by GitHub
parent e5316f45aa
commit dcf2018ec6

View File

@@ -154,12 +154,14 @@ function lookEnt(entity) local ped = PlayerPedId()
end end
function destroyProp(entity) function destroyProp(entity)
if Config.System.Debug then print("^6Bridge^7: ^2Destroying Prop^7: '^6"..entity.."^7'") end if entity then
if IsEntityAttachedToEntity(entity, PlayerPedId()) then if Config.System.Debug then print("^6Bridge^7: ^2Destroying Prop^7: '^6"..entity.."^7'") end
SetEntityAsMissionEntity(entity) if IsEntityAttachedToEntity(entity, PlayerPedId()) then
DetachEntity(entity, true, true) SetEntityAsMissionEntity(entity)
DetachEntity(entity, true, true)
end
DeleteObject(entity)
end end
DeleteObject(entity)
end end
function pushVehicle(entity) function pushVehicle(entity)