local mat = CreateMaterial("******","UnlitGeneric",{["$basetexture"] = "vgui/white_additive",["$ignorez"] = 1})
local mat2 = CreateMaterial("******2","UnlitGeneric",{["$basetexture"] = "vgui/white_additive"})
local depth = {}
local MaterialOverride = render.MaterialOverride
local SetColorModulation = render.SetColorModulation
local function hook4(gm,ply)
if depth[ply] then
MaterialOverride(mat)
SetColorModulation(0,1,0)
else
MaterialOverride(mat2)
SetColorModulation(1,0,0)
end
end
GAMEMODE["PrePlayerDraw"] = hook4
local function hook5(gm,ply)
MaterialOverride()
SetColorModulation(1,1,1)
if depth[ply] then
depth[ply] = false
DrawModel(ply)
end
depth[ply] = true
end
GAMEMODE["PostPlayerDraw"] = hook5