Делаю худ, почти сделал, но заметил что, данные не обновляются.
GnLib
Вот код:
GnLib
Вот код:
Hud:
local function HUDHide ( OldHrpHud )
for k, v in pairs( 'CHudHelth', 'CHudBattery', 'CHudAmmo' ) do
if OldHrpHud == v then return false end
end
end
hook.Add('HudShouldDraw', 'HudHide', HUDHide)
//font
surface.CreateFont('eshkerefont', {
font = 'Open Sans',
size = 24,
weight = 600
} )
surface.CreateFont('eshkerefont2', {
font = 'Open Sans',
size = 30,
weight = 600
} )
surface.CreateFont('utilfont', {
font = 'Open Sans',
size = 28,
weight = 600
} )
//Health
local HpX = ScrW() / 25
local HpY = ScrH() / 1.07
//Hunger
local HungerX = ScrW() / 11
local HungerY = ScrH() / 1.07
//Job, Money
local JobY = ScrH() / 1.17
local MoneyY = ScrH() / 1.25
local utilx = ScrW() / 35
local utilsize = 20
//Texts
//Health,armor
local ply = LocalPlayer()
local hp = ply:Health() or 0
local arm = ply:Armor() or 0
local hungerPly = ply:getDarkRPVar("Energy") or 0
//Pos
//Health
local textHpX = ScrW() / 25
local textHpy = ScrH() / 1.1
local mathpx = ScrW() / 31
local mathpy = ScrH() / 1.07
local mathpW = 30
local mathpH = 30
//Hunger
local textHungerX = ScrW() / 11
local textHungery = ScrH() / 1.1
local mathngx = ScrW() / 12.1
local mathngy = ScrH() / 1.07
local mathngW = 30
local mathngH = 30
//materials
local HungerMat = Material('materials/hud/hunger.png', 'noclamp smooth')
local ArmorMat = Material('materials/hud/armor.png', 'noclamp smooth')
local ClockMat = Material('materials/hud/clock.png', 'noclamp smooth')
local HpMat = Material('materials/hud/hp.png', 'noclamp smooth')
local JobMat = Material('materials/hud/jon.png', 'noclamp smooth')
local LicMat = Material('materials/hud/licence.png', 'noclamp smooth')
//Job Pos
local textJobX = ScrW() / 23
local TextJobY = ScrH() / 1.172
local MatJobH = 18
local MatJobW = 18
local MatJobX = ScrW() / 41
local MatJobY = ScrH() / 1.182
//Money
local MoneytextX = ScrW() / 35
local MoneytextY = ScrH() / 1.252
local MoneyValX = ScrW() / 23
local MoneyValY = ScrH() / 1.252
//Darkrp Modules
local DrpJob = ply:getDarkRPVar("job") or "?"
local DrpMoney = DarkRP.formatMoney(ply:getDarkRPVar("money"))
print(eshkere)
local function HrpHud()
// Health
GNLib.DrawCircle( HpX, HpY, 40, 0, 360, Color(255, 0, 0, 80) )
//Hunger
GNLib.DrawCircle( HungerX, HungerY, 40, 0, 360, Color(252, 187, 4, 80) )
//Job
GNLib.DrawCircle( utilx, JobY, utilsize, 0, 360, Color(33, 35, 34, 255) )
//Money
GNLib.DrawCircle( utilx, MoneyY, utilsize, 0, 360, Color(33, 35, 34, 255) )
//Text
//Health
draw.SimpleText(hp .. '%', 'eshkerefont', textHpX, textHpy, Color(255,255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP)
GNLib.DrawMaterial( HpMat, mathpx, mathpy, mathpW, mathpH )
//Hunger
draw.SimpleText(hungerPly .. '%', 'eshkerefont', textHungerX, textHungery, Color(255,255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP)
GNLib.DrawMaterial( HungerMat, mathngx, mathngy, mathngW, mathngH )
//Job
GNLib.DrawMaterial(JobMat, MatJobX, MatJobY, MatJobW, MatJobH )
draw.SimpleText(DrpJob, 'utilfont', textJobX, TextJobY, Color(255,255,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER)
//Money
draw.SimpleText('$', 'eshkerefont2', MoneytextX, MoneytextY, Color(255,255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
draw.SimpleText(DrpMoney, 'utilfont', MoneyValX, MoneyValY, Color(255,255,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER)
end
hook.Add('HUDPaint', 'HrpHud', HrpHud)