Remove sitanywhere vehicle on death

This commit is contained in:
Xerasin 2022-02-28 08:01:15 -08:00
parent 1920aa5e75
commit ff1c05fd07

View File

@ -624,7 +624,12 @@ hook.Add("AllowPlayerPickup","Nopickupwithalt",function(ply)
end
end)
hook.Add("PlayerDeath","SitSeat",function(pl)
hook.Add("PlayerDeath", "SitSeat", function(pl)
local veh = pl:GetVehicle()
if IsValid(veh) and veh.playerdynseat then
SafeRemoveEntity(veh)
end
for k, v in next, pl:GetChildren() do
if IsValid(v) and v.playerdynseat then
SafeRemoveEntity(v)