--[[-------------------------------------------------------------------------
KDHUD crée par Kinad.
Discord: Kinad330#9223
Steam: https://steamcommunity.com/id/45441545455/
---------------------------------------------------------------------------]]
--[[-------------------------------------------------------------------------
CONFIG
---------------------------------------------------------------------------]]
--Ne pas toucher
local hide = {
CHudHealth = true,
CHudBattery = true,
DarkRP_HUD = true,
DarkRP_Hungermod = true,
CHudAmmo = true,
CHudSecondaryAmmo = true
}
hook.Add("HUDShouldDraw", "S:KD:HUD:Hook:HUDShouldDraw", function(name)
if (hide[name]) then return false end
end)
--Vous pouvez touché :)
local config = {}
config.backColor = Color(25, 25, 25, 245) -- Couleur noir
config.blueColor = Color(0, 80, 117, 245) -- Couleur bleu
config.textColor = Color(255, 255, 255, 255) -- Couleur du text
config.textmoney = " €" -- Money utiliser
config.borderRadius = 1 -- Pourcentage de degrés des angles
config.hungerMod = false -- L'addon est fait pour utiliser l'HungerMod.
--[[-------------------------------------------------------------------------
DESIGN
---------------------------------------------------------------------------]]
hook.Add( "HUDPaint", "KDHUD", function()
draw.RoundedBox(config.borderRadius, ScrW() / 250 * 193.6, ScrH() / 1.054, ScrW() / 6.65, ScrH() / 250, config.blueColor)
draw.RoundedBox(config.borderRadius, ScrW() / 250 * 193.6, ScrH() / 1.049, ScrW() / 6.65, ScrH() / 26, config.backColor)
draw.RoundedBox(config.borderRadius, ScrW() / 300 * 279, ScrH() / 1.054, ScrW() / 15.5, ScrH() / 250, config.blueColor)
draw.RoundedBox(config.borderRadius, ScrW() / 300 * 279, ScrH() / 1.049, ScrW() / 15.5, ScrH() / 26, config.backColor)
--[[-------------------------------------------------------------------------
TEXT
---------------------------------------------------------------------------]]
--Health
surface.SetMaterial(Material("materials/KDHUD/health.png"))
surface.SetDrawColor(255, 255, 255)
surface.DrawTexturedRect(ScrW() / 254 * 204, ScrH() / 1.044, 24, 24)
draw.SimpleText (LocalPlayer():Health() .. "", "KDTEXT", ScrW() / 1.250, ScrH() / 1.038, config.textColor, TEXT_ALIGN_RIGHT, TEXT_ALIGN_RIGHT)
--Armor
surface.SetMaterial(Material("materials/KDHUD/armor.png"))
surface.SetDrawColor(255, 255, 255)
surface.DrawTexturedRect(ScrW() / 239.6 * 204, ScrH() / 1.044, 24, 24)
draw.SimpleText (LocalPlayer():Armor() .. "", "KDTEXT",ScrW() / 1.178 , ScrH() / 1.038, config.textColor, TEXT_ALIGN_RIGHT, TEXT_ALIGN_RIGHT)
--Food
surface.SetMaterial(Material("materials/KDHUD/food.png"))
surface.SetDrawColor(255, 255, 255)
surface.DrawTexturedRect(ScrW() / 227 * 204, ScrH() / 1.044, 24, 24)
draw.SimpleText (math.Round(LocalPlayer():getDarkRPVar("Energy")) .. "", "KDTEXT", ScrW() / 1.1172 , ScrH() / 1.038, config.textColor, TEXT_ALIGN_RIGHT, TEXT_ALIGN_RIGHT)
--Money
draw.SimpleText (LocalPlayer():getDarkRPVar("money") .. config.textmoney, "KDMONEY", ScrW() / 1.01, ScrH() / 1.038, config.textColor, TEXT_ALIGN_RIGHT, TEXT_ALIGN_RIGHT)
if !LocalPlayer():Alive() then return end
if not IsValid(LocalPlayer():GetActiveWeapon()) then return end
if LocalPlayer():GetActiveWeapon():Clip1() ~= -1 then
draw.RoundedBox(config.borderRadius, ScrW() / 278 * 193.6, ScrH() / 1.049, ScrW() / 13.5, ScrH() / 26, config.backColor)
draw.RoundedBox(config.borderRadius, ScrW() / 278 * 193.6, ScrH() / 1.054, ScrW() / 13.5, ScrH() / 250, config.blueColor)
draw.SimpleText(LocalPlayer():GetActiveWeapon():Clip1() .. "/" .. LocalPlayer():GetAmmoCount(LocalPlayer():GetActiveWeapon():GetPrimaryAmmoType()), "KDAMMO",ScrW() / 1.36, ScrH() / 1.028, Color(255, 255, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
end
end)
surface.CreateFont( "KDTEXT", {
font = "Roboto",
extended = false,
size = 17,
weight = 500,
blursize = 0,
scanlines = 0,
antialias = true,
underline = false,
italic = false,
strikeout = false,
symbol = false,
rotary = false,
shadow = false,
additive = false,
outline = false,
} )
surface.CreateFont( "KDMONEY", {
font = "Roboto",
extended = false,
size = 18,
weight = 500,
blursize = 0,
scanlines = 0,
antialias = true,
underline = false,
italic = false,
strikeout = false,
symbol = false,
rotary = false,
shadow = false,
additive = false,
outline = false,
} )
surface.CreateFont( "KDAMMO", {
font = "Roboto",
extended = false,
size = 22,
weight = 500,
blursize = 0,
scanlines = 0,
antialias = true,
underline = false,
italic = false,
strikeout = false,
symbol = false,
rotary = false,
shadow = false,
additive = false,
outline = false,
} )