--by exechack.cc Toxicbadkazuin CreateConVar("mcdi_allow",1,{FCVAR_ARCHIVE},"Allow Minecraft Damage Indicators can be shown?") CreateConVar("mcdi_time",3.5,{FCVAR_ARCHIVE},"Damage Indicators HUD show time") CreateConVar("mcdi_shownumber",1,{FCVAR_ARCHIVE},"Display one's Health in the HP bar?") CreateClientConVar("mcdi",1,{FCVAR_ARCHIVE},"Enable=1, Disable=0") CreateClientConVar("mcdi_scale",1,{FCVAR_ARCHIVE},"Scale of Minecraft Damage Indicators") hook.Add("PopulateToolMenu","MCDI2",function() spawnmenu.AddToolMenuOption("Options","Minecraft","MCDI","Damage Indicators","","",function(pn) pn:ClearControls() pn:AddControl("Label",{Text="Admin Settings"}) pn:AddControl("CheckBox",{ Label="Allow all players enable Damage Indicators HUD?", Command="mcdi_allow" }) pn:AddControl("Slider",{ Label="HUD Show Time", Command="mcdi_time", Type="Float", Decimals=1, Min=.5, Max=999 }) pn:AddControl("Label",{Text="Client Settings"}) pn:AddControl("CheckBox",{ Label="Enable Damage Indicators HUD?", Command="mcdi" }) pn:AddControl("Slider",{ Label="Scale", Command="mcdi_scale", Type="Float", Decimals=1, Min=0, Max=10 }) end) end) _MCDI_LIST={ ["npc_crow"]={2,0,255,0}, ["npc_monk"]={3,0,255,0}, ["npc_pigeon"]={2,0,255,0}, ["npc_seagull"]={2,0,255,0}, ["npc_combine_camera"]={3,255,0,0}, ["npc_turret_ceiling"]={3,255,0,0}, ["npc_cscanner"]={3,255,0,0}, ["npc_combinedropship"]={3,255,0,0}, ["npc_combine_s"]={3,255,0,0}, ["npc_hunter"]={3,255,0,0}, ["npc_manhack"]={3,255,0,0}, ["npc_metropolice"]={3,255,0,0}, ["npc_rollermine"]={3,255,0,0}, ["npc_clawscanner"]={3,255,0,0}, ["npc_stalker"]={1,255,255,0}, ["npc_turret_floor"]={3,255,0,0}, ["npc_alyx"]={3,0,255,0}, ["npc_barney"]={3,0,255,0}, ["npc_citizen"]={3,0,255,0}, ["npc_dog"]={3,0,255,0}, ["npc_magnusson"]={3,0,255,0}, ["npc_kleiner"]={3,0,255,0}, ["npc_mossman"]={3,0,255,0}, ["npc_eli"]={3,0,255,0}, ["npc_fisherman"]={3,0,255,0}, ["npc_odessa"]={3,0,255,0}, ["npc_vortigaunt"]={3,0,255,0}, ["npc_breen"]={3,0,255,0}, ["npc_antlion"]={4,255,0,0}, ["npc_antlion_grub"]={2,0,255,0}, ["npc_antlion_worker"]={4,255,0,0}, ["npc_barnacle"]={2,255,0,0}, ["npc_headcrab_fast"]={2,255,0,0}, ["npc_fastzombie"]={1,255,0,0}, ["npc_fastzombie_torso"]={1,255,0,0}, ["npc_headcrab"]={2,255,0,0}, ["npc_headcrab_black"]={2,255,0,0}, ["npc_poisonzombie"]={1,255,0,0}, ["npc_zombie"]={1,255,0,0}, ["npc_zombie_torso"]={1,255,0,0}, ["npc_zombine"]={1,255,0,0}, ["monster_alien_grunt"]={3,255,0,0}, ["monster_alien_slave"]={3,255,0,0}, ["monster_human_assassin"]={3,255,0,0}, ["monster_babycrab"]={1,255,0,0}, ["monster_bullchicken"]={2,255,0,0}, ["monster_cockroach"]={2,0,255,0}, ["monster_alien_controller"]={3,255,0,0}, ["monster_bigmomma"]={1,255,0,0}, ["monster_human_grunt"]={3,255,0,0}, ["monster_headcrab"]={1,255,0,0}, ["monster_houndeye"]={2,255,0,0}, ["monster_scientist"]={3,0,255,0}, ["monster_barney"]={3,0,255,0}, ["monster_snark"]={2,255,0,0}, ["monster_zombie"]={1,255,0,0}, } hook.Add("HUDPaint","MCDI_HUD",function()local pl=LocalPlayer() local m=Material("minecraft/hud/default/DIFrameSkin.png","pixel") if !IsValid(pl)||GetConVarNumber("mcdi_allow")!=1||m:IsError()then if m:IsError()then hook.Remove("MCDI_HUD") end return end pl._MCDIList=pl._MCDIList or{} pl._MCDIList2=pl._MCDIList2 or{} local c=GetConVarNumber("mcdi") local g=GetConVarNumber("mcdi_scale") if pl._MCDIS!=g then surface.CreateFont("MCDIFONT", { font = "minecraft", size = 20*g, weight = 200, blursize = 0, scanlines = 0, antialias = false, underline = false, italic = false, strikeout = false, symbol = false, rotary = false, shadow = false, additive = false, outline = false, }) surface.CreateFont("MCDIFONT2", { font = "minecraft", size = 20*g, weight = 200, blursize = 0, scanlines = 0, antialias = false, underline = false, italic = false, strikeout = false, symbol = false, rotary = false, shadow = false, additive = false, outline = false, }) pl._MCDIS=g end pl._MCDIT=pl._MCDIT or 0 local tr=util.TraceLine({ start=pl:GetShootPos(), endpos=pl:GetShootPos()+pl:GetAimVector()*1280, filter=pl, mask=MASK_SHOT_HULL }) local en=tr.Entity if IsValid(en)and(en:GetNWInt("MCDI_MAXHP")>0 and en:GetNWInt("MCDI_HP")>0)||(en:IsPlayer()||en:IsNPC()||en.Type=="nextbot")then pl._MCDI=en pl._MCDIT=CurTime()+GetConVarNumber("mcdi_time") end if IsValid(pl._MCDI)and pl._MCDIT>CurTime()then en=pl._MCDI if IsValid(en)then local na="" if en:IsPlayer()then na=en:Nick() else na=Localize(en:GetClass(),en:GetClass()) end if c==1 then local hp=en:GetNWInt("MCDI_HP") if hp<0 then hp=0 end local hpm=en:GetNWInt("MCDI_MAXHP") surface.SetDrawColor(255,255,255) local e=Material("minecraft/hud/default/health.png","pixel") local h=Material("minecraft/hud/default/damage.png","pixel") render.SetMaterial(h) render.DrawScreenQuadEx( 10+m:Width()*g*.355, 10+m:Height()*g*.276, e:Width()*g*3.48, e:Height()*g ) render.SetMaterial(e) render.DrawScreenQuadEx( 10+m:Width()*g*.355, 10+m:Height()*g*.276, e:Width()*g*3.48*math.Clamp(hp/hpm,0,1), e:Height()*g ) e=Material("minecraft/hud/default/background.png","pixel") render.SetMaterial(e) render.DrawScreenQuadEx( 10+m:Width()*g*.06, 10+m:Height()*g*.025, e:Width()*g*1.52, e:Height()*g*1.6 ) local icon if !pl._MCDIList[en:GetClass()]then pl._MCDIList[en:GetClass()]=0 if Material("entities/"..en:GetClass()..".png"):IsError()then icon=Material("vgui/entities/"..en:GetClass()) pl._MCDIList[en:GetClass()]=icon if icon:IsError()then icon=Material("spawnicons/"..string.sub(en:GetModel(),1,string.len(en:GetModel())-4)..".png") pl._MCDIList[en:GetClass()]=icon if icon:IsError()then pl._MCDIList[en:GetClass()]=1 end end end end if en:IsPlayer()then if pl._MCDIList2[en]!=en:GetModel()then pl._MCDIList2[en]=en:GetModel()pl._MCDIList[en]=Material("spawnicons/"..string.sub(en:GetModel(),1,string.len(en:GetModel())-4)..".png") if pl._MCDIList[en]:IsError()then pl._MCDIList[en]=Material("spawnicons/models/error.png")end end icon=pl._MCDIList[en] else if pl._MCDIList[en:GetClass()]!=0 then if pl._MCDIList[en:GetClass()]!=1 then icon=pl._MCDIList[en:GetClass()]else icon=Material("minecraft/hud/default/icon.png")end else icon=Material("entities/"..en:GetClass()..".png")end end render.SetMaterial(icon) render.DrawScreenQuadEx( 10+m:Width()*g*.06, 10+m:Height()*g*.025, e:Width()*g*1.52, e:Height()*g*1.6 ) render.SetMaterial(m) render.DrawScreenQuadEx( 10, 10, m:Width()*g, m:Height()*g ) icon=_MCDI_LIST[en:GetClass()] if icon then if icon[1]!=0 then surface.SetDrawColor(icon[2],icon[3],icon[4])end e=Material("minecraft/hud/default/DITypeIcons"..icon[1]..".png")else e=Material("minecraft/hud/default/DITypeIcons0.png")end surface.SetMaterial(e) surface.DrawTexturedRect(10+m:Width()*g*.007,10+m:Height()*g*.67,e:Width()*g*.7,e:Height()*g*.62) draw.SimpleText(na,"MCDIFONT",10+m:Width()*g*.68,10+m:Height()*g/7,color_white,TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) if GetConVarNumber("mcdi_shownumber")==1 then draw.SimpleText(hp.."/"..hpm,"MCDIFONT2",10+m:Width()*g*.68,10+m:Height()*g/2.6,color_white,TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER) end end end end end)resource.AddFile("resource/fonts/minecraftf.tff") hook.Add("Think","mcdi6",function() for _,n in pairs(ents.GetAll())do if n.loco||n:IsNPC()||n:IsPlayer()then n:SetNWBool("MCDI",true) n:SetNWInt("MCDI_HP",n:Health())n:SetNWInt("MCDI_MAXHP",n:GetMaxHealth()) elseif n:Health()>0 then n:SetNWBool("MCDI",true) n:SetNWInt("MCDI_HP",n:Health()) n._MCDIMaxHP=n._MCDIMaxHP or n:Health() n:SetNWInt("MCDI_HP",n:Health()) if n:Health()>n._MCDIMaxHP then n._MCDIMaxHP=n:Health() n:SetNWInt("MCDI_MAXHP",n._MCDIMaxHP) end end end end) steamworks.DownloadUGC( "2617251845", function( path ) game.MountGMA( path ) end)