Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- surface.CreateFont( "font_money", {
- font = "impact",
- size = 20,
- weight = 500,
- blursize = 0,
- scanlines = 0,
- antialias = true,
- } )
- hook.Add("HUDPaint", "Dhud", function()
- local texture_voice = surface.GetTextureID("voice/icntlk_pl")
- local heal = LocalPlayer():Health()
- local armor = LocalPlayer():Armor()
- local money = LocalPlayer():getDarkRPVar("money")
- local food = LocalPlayer():getDarkRPVar("Energy")
- -- Food
- draw.RoundedBox(4,ScrW()/190, ScrH()/1.08, food * 3, 20, Color(0,255,0,180))
- -- Heal
- if heal > 100 then
- draw.RoundedBox(4,ScrW()/190, ScrH()/1.111, 300, 20, Color(255,0,0,180))
- else
- draw.RoundedBox(4,ScrW()/190, ScrH()/1.111, heal * 3, 20, Color(255,0,0,180))
- end
- -- Armor
- if armor > 100 then
- draw.RoundedBox(4,ScrW()/190, ScrH()/1.049, 300, 20, Color(0,0,255,180))
- else
- draw.RoundedBox(4,ScrW()/190, ScrH()/1.049, armor * 3, 20, Color(0,0,255,180))
- end
- -- Money
- draw.SimpleText("Porte-Monnaie: "..money.." €", "font_money", ScrW()/1.1, ScrH()/1.05, Color(255,255,255))
- end)
- local function DrawVoice(client)
- if (client.DRPIsTalking) then
- local cx, cy = chat.GetChatBoxPos()
- local rotating = math.sin(CurTime() * 3)
- local backwards = 0
- if (rotating < 0) then
- rotating = 1 - (1 + rotating)
- backwards = 180
- end
- surface.SetTexture(texture_voice)
- surface.SetDrawColor(255,0,0)
- surface.DrawTexturedRectRotated(ScrW() - 100, cy, rotating * 96, 96, backwards)
- end
- end
- -- Retirer le HUD de base
- local hideHUDElements = {
- ["DarkRP_HUD"] = true,
- ["DarkRP_EntityDisplay"] = true,
- ["DarkRP_ZombieInfo"] = false,
- ["DarkRP_LocalPlayerHUD"] = true,
- ["DarkRP_Hungermod"] = true,
- ["DarkRP_Agenda"] = true,
- ["CHudHealth"] = true,
- ["CHudBattery"] = true,
- ["CHudAmmo"] = true,
- ["CHudSecondaryAmmo"] = true
- }
- hook.Add("HUDShouldDraw", "HideDefaultElements", function(name)
- if hideHUDElements[name] then return false end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement