Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if SERVER then
- hook.Add("Think", "dmgmode5", function()
- for key, ply in pairs(player.GetAll()) do
- local mode = ply:GetInfoNum("cl_dmg_mode")
- ply.dmgmode5 = ply.dmgmode5 or {}
- local data = ply.dmgmode5
- if mode == 5 then
- if not ply:Alive() then
- ply:Spawn()
- ply:SetPos(data.pos)
- ply:SetVelocity(data.vel)
- if data.wep then
- ply:Give(data.wep)
- ply:SelectWeapon(data.wep)
- end
- else
- data.pos = ply:GetPos()
- data.vel = ply:GetVelocity()
- local wep = ply:GetActiveWeapon()
- if wep:IsValid() then
- data.wep = wep:GetClass()
- end
- end
- end
- end
- end)
- hook.Add("EntityTakeDamage", "dmgmode6", function(a, dmginfo)
- local b = dmginfo:GetAttacker()
- if a:IsPlayer() then
- local mode = a:GetInfoNum("cl_dmg_mode")
- if mode == 6 and a:Health() - dmginfo:GetDamage() < 1 then
- dmginfo:SetDamage(0)
- a:CreateRagdoll()
- umsg.Start("death")
- umsg.Entity(a)
- umsg.End()
- a:SetNotSolid(true)
- timer.Create(tostring(a), 3, 1, function()
- a:SetNotSolid(false)
- a:SetHealth(a:GetMaxHealth())
- end)
- end
- end
- end)
- end
- if CLIENT then
- usermessage.Hook("death", function(umr)
- local ent = umr:ReadEntity()
- if ent:IsValid() then
- ent.RenderOverride = function(p) end
- local wep = ent:GetActiveWeapon()
- wep.RenderOverride = function(p) end
- ent:SetModelScale(Vector(0,0,0))
- timer.Create(tostring(ent), 3,1, function()
- ent.RenderOverride = nil
- wep.RenderOverride = nil
- ent:SetModelScale(Vector(1,1,1))
- end)
- end
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement