Barre de faim SleekHUD

  • Initiateur de la discussion MrGeekoo
  • Date de début
  • Initiateur de la discussion
MrGeekoo

MrGeekoo

Geek suprême
Messages
460
Score réaction
42
Points
130
Bonjour je cherche un codeur qui pourrais ajouter une barre de faim sur le sleekhud en me passant le code à ajouter dans le fichier lua. Si possible gratuitement. Je ne cherche pas de sleekhud filesteal ou leak. Merci !
 
Nardox

Nardox

Psychopathe
Messages
1 143
Score réaction
240
Points
250
Tien:
Code:
-----------------------------------------------------

surface.CreateFont( "namef", {
font = "Bebas Neue",
size = 24,
weight = 500,
blursize = 0,
scanlines = 0,
antialias = true
} )
surface.CreateFont( "namefsmall", {
font = "Bebas Neue",
size = 16,
weight = 500,
blursize = 0,
scanlines = 0,
antialias = true
} )
surface.CreateFont( "jobf", {
font = "Bebas Neue",
size = 34,
weight = 500,
blursize = 0,
scanlines = 0,
antialias = true
} )
surface.CreateFont( "jobfsmall", {
font = "Bebas Neue",
size = 24,
weight = 500,
blursize = 0,
scanlines = 0,
antialias = true
} )
surface.CreateFont( "jobfxsmall", {
font = "Bebas Neue",
size = 16,
weight = 500,
blursize = 0,
scanlines = 0,
antialias = true
} )
surface.CreateFont( "moneyf", {
font = "Bebas Neue",
size = 48,
weight = 500,
blursize = 0,
scanlines = 0,
antialias = true
} )
surface.CreateFont( "moneyfsmall", {
font = "Bebas Neue",
size = 36,
weight = 500,
blursize = 0,
scanlines = 0,
antialias = true
} )
surface.CreateFont( "salaryf", {
font = "Bebas Neue",
size = 24,
weight = 500,
blursize = 0,
scanlines = 0,
antialias = true
} )
surface.CreateFont( "healthf", {
font = "Bebas Neue",
size = 16,
weight = 500,
blursize = 0,
scanlines = 0,
antialias = true
} )
surface.CreateFont( "healthf2", {
font = "Bebas Neue",
size = 20,
weight = 500,
blursize = 0,
scanlines = 0,
antialias = true
} )
surface.CreateFont( "wantf", {
font = "Bebas Neue",
size = 36,
weight = 500,
blursize = 0,
scanlines = 0,
antialias = true
} )
surface.CreateFont( "hungerf", {
font = "Bebas Neue",
size = 14,
weight = 500,
blursize = 0,
scanlines = 0,
antialias = true
} )
local hideHUDElements = { -- if you DarkRP_HUD this to true, ALL of DarkRP's HUD will be disabled. That is the health bar and stuff, -- but also the agenda, the voice chat icons, lockdown text, player arrested text and the names above players' heads ["DarkRP_HUD"] = true, -- DarkRP_EntityDisplay is the text that is drawn above a player when you look at them. -- This also draws the information on doors and vehicles ["DarkRP_EntityDisplay"] = false, -- DarkRP_ZombieInfo draws information about zombies for admins who use /showzombie. ["DarkRP_ZombieInfo"] = false, -- This is the one you're most likely to replace first -- DarkRP_LocalPlayerHUD is the default HUD you see on the bottom left of the screen -- It shows your health, job, salary and wallet ["DarkRP_LocalPlayerHUD"] = true, -- Drawing the DarkRP agenda ["DarkRP_Agenda"] = true
}
-- this is the code that actually disables the drawing.
hook.Add("HUDShouldDraw", "HideDefaultDarkRPHud", function(name) if hideHUDElements[name] then return false end
end)
--if true then return end -- REMOVE THIS LINE TO ENABLE THE CUSTOM HUD BELOW

local Health = 0
HM = {}
HM.UsingHungerMod = true
local av
local name
local oldName
local function DrawPlayerAvatar( p ) oldName = LocalPlayer():Name() print( oldName ) av = vgui.Create("AvatarImage") av:SetPos(64,ScrH() - 140) -- deuxieme 130 defaut av:SetSize(56, 56) av:SetPlayer( p, 64 ) av:SetVisible(true)
end
local function formatNumber(n) if not n then return "" end if n >= 1e14 then return tostring(n) end n = tostring(n) local sep = sep or "," local dp = string.find(n, "%.") or #n+1 for i=dp-4, 1, -3 do n = n:sub(1, i) .. sep .. n:sub(i+1) end return n
end
local function hudPaint() draw.RoundedBox( 4, 9, ScrH() - 153, 392, 147, Color( 0, 0, 0, 255 ) ) draw.RoundedBox( 4, 10, ScrH() - 152, 390, 145, Color( 38, 38, 38, 255 ) ) draw.RoundedBoxEx( 4, 10, ScrH() - 152, 40, 80, Color( 54, 54, 54, 255 ), true, false, false, false ) draw.RoundedBoxEx( 4, 400 - 156, ScrH() - 152, 156, 80, Color( 54, 54, 54, 255 ), false, true, false, false ) surface.SetDrawColor( 0, 0, 0, 255 ) surface.DrawLine( 10, ScrH() - 112, 50, ScrH() - 112 ) surface.SetDrawColor( 61, 61, 61, 255 ) surface.DrawLine( 10, ScrH() - 111, 50, ScrH() - 111 ) surface.SetDrawColor( 4, 4, 4, 255 ) surface.DrawLine( 10, ScrH() - 72, 400, ScrH() - 72 ) surface.SetDrawColor( 61, 61, 61, 255 ) surface.DrawLine( 10, ScrH() - 71, 400, ScrH() - 71 ) surface.SetDrawColor( 84, 84, 84, 255 ) surface.DrawLine( 11, ScrH() - 152, 398, ScrH() - 152 ) surface.SetDrawColor( 24, 24, 24, 255 ) surface.DrawLine( 400 - 156, ScrH() - 152, 400 - 156, ScrH() - 72 ) surface.SetDrawColor( 24, 24, 24, 255 ) surface.DrawLine( 50, ScrH() - 152, 50, ScrH() - 72 ) local font surface.SetFont( "namef" ) local PlayerName = LocalPlayer():Name() local Width, Height = surface.GetTextSize(PlayerName) if Width > 100 then font = "namefsmall" else font = "namef" end surface.SetFont( "namefsmall" ) local wh, hw = surface.GetTextSize(PlayerName) if font == "namefsmall" and wh > 100 then PlayerName = string.sub( LocalPlayer():Name(), 1, 18 )..".." end if font == "namef" and Width < 100 then local PlayerName = LocalPlayer():Name() end draw.SimpleText( PlayerName, mfont, 130, ScrH() - 138, Color( 255, 255, 255 ) ) local jfont local jof local eof surface.SetFont( "jobf" ) local PlayerJob = team.GetName(LocalPlayer():Team()) local wi, hi = surface.GetTextSize(PlayerJob) if wi > 100 and wi < 140 then jfont = "jobfsmall" jof = 2 elseif wi > 140 then jfont = "jobfxsmall" jof = 4 else jfont = "jobf" jof = 0 end if jfont == "jobfsmall" and font == "namefsmall" then jof = jof - 4 elseif jfont == "jobf" and font == "namefsmall" then jof = jof - 6 elseif jfont == "jobfxsmall" and font == "namefsmall" then jof = jof - 8 else jof = jof end draw.SimpleText( PlayerJob, jfont, 130, ScrH() - 122 + jof, Color(5, 255, 0, 255)) if LocalPlayer():IsUserGroup("VIP") then draw.DrawText( "VIP OmegalphaRP", "hungerf", 130, ScrH() - 90 + jof, Color(5, 255, 0, 255)) elseif LocalPlayer():IsUserGroup("VIP+") then draw.DrawText( "VIP+ OmegalphaRP", "hungerf", 130, ScrH() - 90 + jof, Color(5, 255, 0, 255)) else draw.DrawText( "Joueur OmegalphaRP", "hungerf", 130, ScrH() - 90 + jof, Color(5, 255, 0, 255)) end local mfont surface.SetFont( "moneyf" ) local PlayerMoney = formatNumber(LocalPlayer():getDarkRPVar( "money" )) local wl, hl = surface.GetTextSize(PlayerMoney) if wl > 140 then mfont = "moneyfsmall" else mfont = "moneyf" end draw.SimpleText( "€"..PlayerMoney, mfont, 320, ScrH() - 152, Color( 255, 0, 0, 255 ), TEXT_ALIGN_CENTER ) draw.SimpleText( "Salaire: €"..formatNumber(LocalPlayer():getDarkRPVar( "salary" )), "salaryf", 320, ScrH() - 106, Color( 200, 200, 200, 255 ), TEXT_ALIGN_CENTER ) local x, y = 30, ScrH() - 33 local localplayer = LocalPlayer() Health = math.min(100, (Health == localplayer:Health() and Health) or Lerp(0.1, Health, localplayer:Health())) local DrawHealth = math.Min(Health / GAMEMODE.Config.startinghealth, 1) local Border = math.Min(6, math.pow(2, math.Round(3*DrawHealth))) draw.RoundedBox(4, 20 + 60, y - 33, 309 - 7, 16, Color(0,0,0,200)) if LocalPlayer():Health() > 0 then draw.RoundedBox(4, 21 + 60, y - 32, (309 - 9) * DrawHealth, 14, Color(255,40,40,180)) end draw.DrawText(math.Max(0, math.Round(localplayer:Health())), "healthf", 302 / 2 + 80, y - 33, Color(255,255,255,200), 1, TEXT_ALIGN_CENTER) local hunger = math.ceil(LocalPlayer():getDarkRPVar("Energy") or 0) draw.RoundedBox(4, 20 + 60, ScrH() - 46, 302, 16, Color(0,0,0,200)) if hunger > 0 then draw.RoundedBox(4, 21 + 60, ScrH() - 45, hunger * 3, 14, Color(255, 122, 0, 255)) end if hunger > 1 then draw.SimpleText(hunger, "healthf", 80 + 302 / 2, ScrH() - 46, Color(255,255,255,200), TEXT_ALIGN_CENTER) else draw.SimpleText("Affamé !", "healthf", 80 + 302 / 2, ScrH() - 46, Color(255,255,255,200), TEXT_ALIGN_CENTER) end local armor = LocalPlayer():Armor() draw.RoundedBox(4, 20 + 60, ScrH() - 25, 302, 16, Color(0,0,0,200)) if armor > 0 then draw.RoundedBox(4, 21 + 60, ScrH() - 24, armor * 3, 14, Color(40,40,255,255)) end draw.SimpleText(armor, "healthf", 80 + 302 / 2, ScrH() - 25, Color(255,255,255,200), TEXT_ALIGN_CENTER) draw.SimpleText("Vie:", "healthf2", 20, ScrH() - 67, Color(214, 16, 16, 255), TEXT_ALIGN_LEFT) draw.SimpleText("Faim:", "healthf2", 20, ScrH() - 47, Color(255, 122, 0, 255), TEXT_ALIGN_LEFT) draw.SimpleText("Armure:", "healthf2", 20, ScrH() - 28, Color(0,60,255), TEXT_ALIGN_LEFT) if LocalPlayer():isWanted() then draw.SimpleText("!", "wantf", 30, ScrH() - 108, Color( math.sin( CurTime() * 3 ) * 255, 0, 0 ), TEXT_ALIGN_CENTER) else draw.SimpleText("!", "wantf", 30, ScrH() - 108, Color( 0, 0, 0, 255 ), TEXT_ALIGN_CENTER) end draw.SimpleText("+", "wantf", 30, ScrH() - 148, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER) if av then return else DrawPlayerAvatar( LocalPlayer() ) end
end
hook.Add("HUDPaint", "DarkRP_Mod_HUDPaint", hudPaint)
hook.Add( "HUDShouldDraw", "Remove default", function( name ) if ( name == "CHudHealth" or name == "CHudBattery" ) then return false end
end )
hook.Add("HUDDrawTargetID", "HMHUD", function() return
end)
A remplacer dans darkrpmodification-master\lua\darkrp_modules\hudreplacement\cl_hudreplacement.lua
 
  • Initiateur de la discussion
MrGeekoo

MrGeekoo

Geek suprême
Messages
460
Score réaction
42
Points
130
Il est un peux moche quand meme x)
 
  • Initiateur de la discussion
MrGeekoo

MrGeekoo

Geek suprême
Messages
460
Score réaction
42
Points
130
Tu la filesteal ? Je reconnais le
-----------------------------------------------------
au début des addons filesteal
...
 
Nardox

Nardox

Psychopathe
Messages
1 143
Score réaction
240
Points
250
Non
 
Nardox

Nardox

Psychopathe
Messages
1 143
Score réaction
240
Points
250
A la base il était sur mTx je l'ai juste modif
 
  • Initiateur de la discussion
MrGeekoo

MrGeekoo

Geek suprême
Messages
460
Score réaction
42
Points
130
Si tu la pas filesteal tu la eu comment ? De base le sleekhud n'a pas de
-----------------------------------------------------
au début seuleument si tu le filesteal.
 
  • Initiateur de la discussion
MrGeekoo

MrGeekoo

Geek suprême
Messages
460
Score réaction
42
Points
130
Discord d'entraide
Rejoignz-nous sur Discord