diff --git a/gamemodes/zombiesurvival/gamemode/cl_postprocess.lua b/gamemodes/zombiesurvival/gamemode/cl_postprocess.lua index e5efad4..0d07ce9 100644 --- a/gamemodes/zombiesurvival/gamemode/cl_postprocess.lua +++ b/gamemodes/zombiesurvival/gamemode/cl_postprocess.lua @@ -260,9 +260,16 @@ function GM:ToggleZombieVision(onoff) end end -net.Receive("zs_togglezvision", function(length) - gamemode.Call("ToggleZombieVision") -end) +function GM:PlayerButtonDown( ply, button ) + if not IsFirstTimePredicted() then return end + if not IsValid( ply ) or ply != MySelf then return end + + if ply:Team() == TEAM_UNDEAD and ply:Alive() then + if button == KEY_F then + self:ToggleZombieVision() + end + end +end local CModWhiteOut = { ["$pp_colour_addr"] = 0, diff --git a/gamemodes/zombiesurvival/gamemode/init.lua b/gamemodes/zombiesurvival/gamemode/init.lua index e034c7f..6904402 100644 --- a/gamemodes/zombiesurvival/gamemode/init.lua +++ b/gamemodes/zombiesurvival/gamemode/init.lua @@ -474,7 +474,6 @@ function GM:AddNetworkStrings() util.AddNetworkString("zs_deployableout") util.AddNetworkString("zs_trinketconsumed") util.AddNetworkString("zs_nailremoved") - util.AddNetworkString("zs_togglezvision") util.AddNetworkString("zs_remantlercontent") util.AddNetworkString("zs_classunlockstate") util.AddNetworkString("zs_changeclass") @@ -4314,11 +4313,6 @@ end function GM:PlayerSwitchFlashlight(pl, newstate) if pl:Team() == TEAM_UNDEAD then - if newstate then - net.Start("zs_togglezvision") - net.Send(pl) - end - return false end