This commit is contained in:
lifestorm
2024-08-05 18:40:29 +03:00
parent c4d91bf369
commit 324f19217d
8040 changed files with 1853423 additions and 21 deletions

View File

@@ -0,0 +1,54 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
ENT.Type = "point"
ENT.Base = "base_point"
ENT.Damager = nil
ENT.KillName = nil
function ENT:KeyValue(key, value)
if key == "damager" then
self.Damager = tostring(value)
elseif key == "killname" then
self.KillName = tostring(value)
end
end
function ENT:AcceptInput(name, activator, caller, data)
if name == "SetActivatorAsDamageOwner" then
if not self.Damager then return end
if IsValid(activator) and activator:IsPlayer() then
for _, ent in ipairs(ents.FindByName(self.Damager) or {}) do
if IsValid(ent) and ent.SetDamageOwner then
Dev(2, "Setting damageowner on", ent, ent:GetName())
ent:SetDamageOwner(activator)
ent.ScoreName = self.KillName
end
end
end
return true
elseif name == "ClearDamageOwner" then
if not self.Damager then return end
for _, ent in ipairs(ents.FindByName(self.Damager) or {}) do
if IsValid(ent) and ent.SetDamageOwner then
Dev(2, "Clearing damageowner on", ent, ent:GetName())
ent:SetDamageOwner(nil)
end
end
return true
end
end