Вообщем проблема в том что при смене разрешения экрана худ кривой (Кроме полос хп и тд) буду очень блогадарен, ибо я не понимаю, и делал
local x = 15,
local y = ScrH() -150
а толку 0
Также скрины в норм разрешении и в маленьком
local x = 15,
local y = ScrH() -150
а толку 0
Также скрины в норм разрешении и в маленьком
if (SERVER) then return end local function HUDHide ( myhud ) for k, v in pairs{ 'CHudHealth', 'CHudBattery', 'CHudAmmo', 'DarkRP_Hungermod' } do if myhud == v then return false end end end hook.Add('HUDShouldDraw', 'HuhHide', HUDHide) surface.CreateFont('clasic', { font = 'BudgetLabel', size = 14, weight = 600, }) surface.CreateFont('clasicc', { font = 'Open Sans Bold', size = 34, weight = 600, }) surface.CreateFont('clasiccc', { font = 'Open Sans Bold', size = 24, weight = 600, }) local function MyFirstHud() local ply = LocalPlayer() local hp = ply:Health() or 0 local maxhp = ply:GetMaxHealth() or 0 local arm = ply:Armor() or 0 local salary = ply:getDarkRPVar( 'salary' ) local armom = ply:Armor() local maxarmor = ply:GetMaxArmor() local money = ply:getDarkRPVar( 'money' ) local job = ply:getDarkRPVar ( 'job' ) local lockdown = GetGlobalBool( 'DarkRP_LockDown' ) local ct = team.GetColor( ply:Team() ) local wanted = ply:getDarkRPVar( 'wanted' ) local wantedr = ply:getDarkRPVar( 'wantedReason' ) local hungree = ply:getDarkRPVar('Energy') or 1 local playerName = LocalPlayer():Nick() local license = ply:getDarkRPVar('License') --HP draw.RoundedBox( 5, 55, ScrH() - 20, 150, 10, Color( 255, 255, 255, 117 ) ) if hp <= 100 then draw.RoundedBox( 3, 55, ScrH() - 20, math.Clamp(hp, 0, maxhp)*1.5, 10, Color( 0, 253, 16, 240 ) ) else draw.RoundedBox( 3, 55, ScrH() - 20, 100, 10, Color( 0, 253, 16, 240 ) ) end ---ARMOR draw.RoundedBox( 5, 255, ScrH() - 20, 150, 10, Color( 255, 255, 255, 117 ) ) if arm <= 100 then draw.RoundedBox( 3, 255, ScrH() - 20, math.Clamp(arm, 0, 100)*1.5, 10, Color( 0, 0, 255, 240 ) ) else draw.RoundedBox( 3, 255, ScrH() - 20, 100, 10, Color( 0, 0, 255, 240 ) ) end --- ГОЛОД draw.RoundedBox( 5, 455, ScrH() - 20, 150, 10, Color( 255, 255, 255, 117 ) ) if hungree <= 100 then draw.RoundedBox( 3, 455, ScrH() - 20, math.Clamp( hungree, 0, 100)*1.5, 10, Color( 255, 93, 0, 240 ) ) else draw.RoundedBox( 3, 455, ScrH() - 20, 100, 10, Color( 0, 253, 16, 240 ) ) end ---деньги draw.RoundedBox( 5, 1200, ScrH() - 770, 160, 50, Color( 72, 72, 72, 150 ) ) draw.SimpleText( money,'clasicc', ScrH() - -480, 5, Color( 255, 255, 255, 250 ) ) draw.SimpleText('$:','clasicc', ScrH() - -440, 5, Color( 0, 155, 63, 255 ) ) ----- license --- Розыск! if wanted then draw.SimpleText('Вы в розыске!','clasiccc', ScrH() - 765, 650, Color( 255, 0, 0, 240 ) ) end --------------------------------------текста draw.SimpleText(playerName,'clasicc', ScrH() - 765, 610, Color( 185, 185, 185, 250 ) ) draw.SimpleText(job,'clasic', ScrH() - 762, 640, Color( 185, 185, 185, 250 ) ) -----------------хп draw.SimpleText('Здоровье:', 'clasic', ScrH() - 760, 730, Color( 0, 253, 16, 240 ) ) draw.SimpleText(hp, 'clasic', ScrH() - 690, 730, Color( 0, 253, 16, 240 ) ) ---------- броня draw.SimpleText('Броня:','clasic', ScrH() - 540, 730, Color( 0, 0, 255, 240 ) ) draw.SimpleText(arm,'clasic', ScrH() - 490, 730, Color( 0, 0, 255, 240 ) ) -------голод draw.SimpleText('Голод:','clasic', ScrH() - 330, 730, Color( 255, 93, 0, 240 ) ) draw.SimpleText(hungree,'clasic', ScrH() - 280, 730, Color( 255, 93, 0, 240 ) ) ---ком час if GetGlobalBool( 'DarkRP_LockDown' ) then draw.RoundedBox( 4, 1, ScrH() - 750, 370, 50, Color( 72, 72, 72, 150 ) ) draw.SimpleText('Внимание! В городе объявлен Коменданский Час.','clasic', ScrH() - 760, 35, Color( 255, 0, 0, 255 ) ) end --surface.SetTexture(surface.GetTextureID("materials/hp")) --surface.DrawTexturedRect(30 + 1,ScrH() - 22,16,16) end hook.Add('HUDPaint', 'MyFirstHud', MyFirstHud) |