nuke sfx
This commit is contained in:
parent
c3260efacb
commit
85a7e1360a
@ -6,6 +6,8 @@ local StatsPanel = {}
|
||||
local X = 0
|
||||
local Y = 0
|
||||
|
||||
local NUKE_SFX = "readyforlaunch.mp3"
|
||||
|
||||
function StatsPanel:Init()
|
||||
local TextColor = Color(255, 255, 255)
|
||||
local TextFont = "ChatFont"
|
||||
@ -102,3 +104,9 @@ end
|
||||
hook.Add("PopulateToolMenu", "edshot_player_stats_panel_config", function()
|
||||
spawnmenu.AddToolMenuOption("Options", "Player", "edshot_player_stats_panel_config", "Statistics", "", "", StatsPanelConfig)
|
||||
end)
|
||||
|
||||
net.Receive("edshot_player_stats_killstreak_sfx", function()
|
||||
if net.ReadBool() then
|
||||
surface.PlaySound(NUKE_SFX)
|
||||
end
|
||||
end)
|
||||
|
@ -2,6 +2,8 @@
|
||||
local NUKE_KILLSTREAK = 25
|
||||
local NUKE_SWEP = "m9k_orbital_strike"
|
||||
|
||||
util.AddNetworkString("edshot_player_stats_killstreak_sfx")
|
||||
|
||||
hook.Add("PlayerDeath", "edshot_player_stats_killstreak", function(victim, inflictor, attacker)
|
||||
if IsValid(attacker) and attacker:IsPlayer() then
|
||||
local deaths = attacker:Deaths()
|
||||
@ -26,6 +28,10 @@ hook.Add("PlayerDeath", "edshot_player_stats_killstreak", function(victim, infli
|
||||
|
||||
if (k1 ~= 0) and (k2 == k1) then
|
||||
attacker:Give(NUKE_SWEP)
|
||||
|
||||
net.Start("edshot_player_stats_killstreak_sfx")
|
||||
net.WriteBool(true)
|
||||
net.Send(attacker)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user