Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Commit

Permalink
Made SpecDM_Respawn local
Browse files Browse the repository at this point in the history
  • Loading branch information
MinIsMin committed Jan 22, 2017
1 parent 00a17c8 commit 68ce10c
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lua/sv_specdm_overrides.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ hook.Add("PlayerSpawn", "PlayerSpawn_SpecDM", function(ply)
end
end)

local function SpecDM_Respawn(ply)
ply:SetNWBool("SpecDM_PreSpawnGhost", false)
ply:SetNWBool("SpecDM_CanSpawnGhost", false)
if ply:IsGhost() then
ply:UnSpectate()
ply:Spawn()
ply:GiveGhostWeapons()
SpecDM:RelationShip(ply)
end
end

hook.Add("PlayerDeath", "PlayerDeath_SpecDM", function(victim, inflictor, attacker)
if victim:IsGhost() then
victim:SetNWBool("SpecDM_PreSpawnGhost", true)
Expand Down Expand Up @@ -328,15 +339,4 @@ hook.Add("EntityEmitSound", "EntityEmitSound_SpecDM", function(t)
else
return
end
end)

function SpecDM_Respawn(ply)
ply:SetNWBool("SpecDM_PreSpawnGhost", false)
ply:SetNWBool("SpecDM_CanSpawnGhost", false)
if ply:IsGhost() then
ply:UnSpectate()
ply:Spawn()
ply:GiveGhostWeapons()
SpecDM:RelationShip(ply)
end
end
end)

0 comments on commit 68ce10c

Please sign in to comment.