DISGUISE = {} function DISGUISE.CreateMenu(parent) local dform = vgui.Create("DForm", parent) dform:SetName("Disguise control") dform:StretchToParent(0,0,0,0) dform:SetAutoSize(false) local owned = LocalPlayer():HasEquipmentItem(EQUIP_DISGUISE) if not owned then dform:Help("You are not carrying a disguise!") return dform end local dcheck = vgui.Create("DCheckBoxLabel", dform) dcheck:SetText("Enable disguise") dcheck:SetIndent(5) dcheck:SetValue(LocalPlayer():GetNWBool("disguised", false)) dcheck.OnChange = function(s, val) RunConsoleCommand("ttt_set_disguise", val and "1" or "0") end dform:AddItem(dcheck) dform:Help("When your disguise is active, your name, health and karma do not show when someone looks at you. In addition, you will be hidden from a Detective's radar.") dform:Help("Press Numpad Enter to toggle the disguise without using the menu. You can also bind a different key to \"ttt_toggle_disguise\" using the console.") dform:SetVisible(true) return dform end function DISGUISE.Draw(client) if not client or not client:IsActiveTraitor() then return end if not client:GetNWBool("disguised", false) then return end surface.SetFont("TabLarge") surface.SetTextColor(255, 0, 0, 230) local text = "Disguised. Your name is hidden." local w, h = surface.GetTextSize(text) surface.SetTextPos(36, ScrH() - 160 - h) surface.DrawText(text) end local function DisguiseToggle(ply) if IsValid(ply) and ply:IsActiveTraitor() then if not ply:GetNWBool("disguised", false) then RunConsoleCommand("ttt_set_disguise", "1") else RunConsoleCommand("ttt_set_disguise", "0") end end end concommand.Add("ttt_toggle_disguise", DisguiseToggle)