Pourquoi mon HUD ne fonctionne pas ?

  • Initiateur de la discussion
Deadman69330

Deadman69330

Psychopathe
Messages
2 289
Score réaction
309
Points
290
Salut,

Je suis en train de faire mon HUD en solo et quand j'ai essayer de le mettre sur un serveur, il n'y avait que le HUD par défaut du Dakrp (Oui, j'ai vérif les Disableddefaults.lua)

Mon code est dans "dead_hud/lua/autorun/client/deadman.lua"
Et voilà le code
Code:
local CONFIG.DeadHud.NamePopup = 0; -- Afficher le nom du joueur en jeu (1 = activer, 0 = désactiver)
local CONFIG.DeadHud.gamemode = "Darkrp"; -- Choississez un gamemode parmis "Darkrp", "Sandbox", "TTT" ATTENTION, SENSIBLE A LA CASSE !
local CONFIG.DeadHud.color.hp.background = Color(0,0,0,170); -- Couleur du background de la barre de vie
local CONFIG.DeadHud.color.armor.background = Color(0,0,0,170); -- Couleur du background de la barre d'armure
local CONFIG.DeadHud.color.money.background = Color(0,0,0,170); -- Couleur du background de la barre d'argent
local CONFIG.DeadHud.color.job.background = Color(0,0,0,170); -- Couleur du background de la barre du job
local CONFIG.DeadHud.color.hp.front = Color(255,0,0,255); -- Couleur de la barre de vie si la vie est supérieure à 100
local CONFIG.DeadHud.color.hp.front.2 = Color(255,0,0,255); -- Couleur de la barre de vie
local CONFIG.DeadHud.color.food.front = Color(0,255,38,255); -- Couleur de la barre de bouffe
local CONFIG.DeadHud.color.armor.front = Color(0,13,255,255,255); -- Couleur de la barre d'armure
local CONFIG.DeadHud.color.armor.front.2 = Color(0,13,255,255,255); -- Couleur de la barre d'armure si l'armure est supérieure à 100
-- Darkrp Settings
local CONFIG.DeadHud.FoodmodEnable = 0;
local CONFIG.DefautHud.previousmoney = "Argent : ";
local CONFIG.DeadHud.variablecurrency = " €"; -- La monnaie utilisée sur votre serveur
local CONFIG.DeadHud.jobvariable = "Job : "; -- Le mot afficher avant le Job du joueur
-- NO EDIT IS NEEDED UNDER THIS LINE
-- NO EDIT IS NEEDED UNDER THIS LINE
-- NO EDIT IS NEEDED UNDER THIS LINE
-- NO EDIT IS NEEDED UNDER THIS LINE
-- NO EDIT IS NEEDED UNDER THIS LINE
-- NO EDIT IS NEEDED UNDER THIS LINE
surface.CreateFont( "dhud-font-1", { font = "impact", size = 15, weight = 500, blursize = 0, scanlines = 0, antialias = true,
} )
surface.CreateFont( "dhud-font-2", { font = "impact", size = 19, weight = 500, blursize = 0, scanlines = 0, antialias = true,
} )
surface.CreateFont( "dhud-font-3", { font = "impact", size = 20, weight = 500, blursize = 0, scanlines = 0, antialias = true,
} )
-- Add Darkrp compatibility
-- Add Darkrp compatibility
-- Add Darkrp compatibility
if CONFIG.DeadHud.gamemode == "Darkrp" then
hook.Add("HUDPaint", "Dhud", function()
local VAR.Darkrp.heal = LocalPlayer():Health()
local VAR.Darkrp.armor = LocalPlayer():Armor()
local VAR.Darkrp.food = LocalPlayer():getDarkRPVar("Energy")
local VAR.Darkrp.money = LocalPlayer():getDarkRPVar("money")
local VAR.Darkrp.salaire = LocalPlayer():getDarkRPVar("salary")
local VAR.Darkrp.job = team.GetName(LocalPlayer():Team())
-- Cote gauche
draw.RoundedBox(4,7, ScrH() - 52, 308, 24, CONFIG.DeadHud.color.hp.background)
draw.RoundedBox(4,7, ScrH() - 82, 308, 24, CONFIG.DeadHud.color.armor.background)
-- Cote droit
draw.RoundedBox(4,1800, ScrH() - 78, 150, 24, CONFIG.DeadHud.color.job.background)
draw.RoundedBox(4,1800, ScrH() - 52, 150, 24, CONFIG.DeadHud.color.money.background)
draw.SimpleText(CONFIG.DeadHud.jobvariable..VAR.Darkrp.job, "dhud-font-2", 1800, ScrH() - 75, Color(255,255,255,255))
draw.SimpleText(CONFIG.DeadHudpreviousmoney..VAR.Darkrp.money..CONFIG.DeadHud.variablecurrency, "dhud-font-2", 1800, ScrH() - 52, Color(255,255,255,255))
-- Food if LocalPlayer():Team() == TEAM_COOK then draw.RoundedBox(4,7, ScrH() - 102, 308, 18, Color(0,0,0,170)) draw.RoundedBox(4,10, ScrH() - 100, food * 3, 14, CONFIG.DeadHud.color.food.front) draw.SimpleText(VAR.Darkrp.food, "dhud-font-1", 150, ScrH() - 102, Color(255,255,255,255)) end
-- Wanted if LocalPlayer():getDarkRPVar("wanted") then draw.RoundedBox(4,4, ScrH() - 1070, 160, 20, Color(0,0,0,170)) draw.SimpleText("Vous êtes recherché !", "dhud-font-3", 10, ScrH() - 1070, Color(255,0,0,160)) end
-- Heal if VAR.Darkrp.heal > 100 then draw.RoundedBox(4,10, ScrH() - 50, 304, 20, CONFIG.DeadHud.color.hp.front) draw.SimpleText(VAR.Darkrp.heal, "dhud-font-1", 150, ScrH() - 48, Color(255,255,255,190)) else draw.RoundedBox(4,10, ScrH() - 50, VAR.Darkrp.heal * 3, 20, CONFIG.DeadHud.color.hp.front.2) draw.SimpleText(VAR.Darkrp.heal, "dhud-font-1", 150, ScrH() - 48, Color(255,255,255,190)) end
-- Armor if VAR.Darkrp.armor == 0 then draw.SimpleText("Vous n'avez pas d'armure", "dhud-font-2", 90, ScrH() - 78, Color(255,255,255,190)) end if VAR.Darkrp.armor > 100 then draw.RoundedBox(4,10, ScrH() - 80, 304, 20, CONFIG.DeadHud.color.armor.front.2) draw.SimpleText(VAR.Darkrp.armor, "dhud-font-1", 150, ScrH() - 78, Color(255,255,255,190)) else draw.RoundedBox(4,10, ScrH() - 80, VAR.Darkrp.armor *3, 20, CONFIG.DeadHud.color.armor.front) draw.SimpleText(VAR.Darkrp.armor, "dhud-font-1", 150, ScrH() - 78, Color(255,255,255,190)) end
-- Gun licence if localplayer:getDarkRPVar("HasGunlicense") then draw.RoundedBox(4,1685, ScrH() - 105, 308, 24, Color(0,0,0,170)) draw.SimpleText("Vous possèder une licence d'armes", "dhud-font-2", 1690, ScrH() - 102, Color(255,255,255,255)) end
-- Name Popup if CONFIG.DeadHud.NamePopup == 0 then function GAMEMODE:HUDDrawTargetID() return false end end
end
-- Add Sandbox compatibility
-- Add Sandbox compatibility
-- Add Sandbox compatibility
if CONFIG.DeadHud.gamemode == "Sandbox" then local VAR.Sandbox.heal = Player:GetHeal() local VAR.Sandbox.name = Player:GetName
-- Heal draw.RoundedBox(4,7, ScrH() - 52, 308, 24, CONFIG.DeadHud.color.hp.background) if VAR.Sandbox.heal > 100 then draw.RoundedBox(4,10, ScrH() - 50, 304, 20, CONFIG.DeadHud.color.hp.front) draw.SimpleText(VAR.Sandbox.heal, "dhud-font-1", 150, ScrH() - 48, Color(255,255,255,190)) else draw.RoundedBox(4,10, ScrH() - 50, VAR.Sandbox.heal * 3, 20, CONFIG.DeadHud.color.hp.front.2) draw.SimpleText(VAR.Sandbox.heal, "dhud-font-1", 150, ScrH() - 48, Color(255,255,255,190)) end
end
-- All gamemode compatibility
if LocalPlayer():GetActiveWeapon() != NULL then local ammoinclip local extraammo local ammoinclip2 local extraammo2 if LocalPlayer():GetActiveWeapon():Clip1() < 0 then ammoinclip = "" -- Si les mun sont infinie extraammo = "" ammoinclip2 = "" extraammo2 = "" else LocalPlayer():GetActiveWeapon():Clip1() > -1 then ammoinclip = LocalPlayer():GetActiveWeapon():Clip1() extraammo = LocalPlayer():GetAmmoCount( LocalPlayer():GetActiveWeapon():GetPrimaryAmmoType() ) -- Affiche chargeur ammoinclip2 = LocalPlayer():GetActiveWeapon():Clip2() -- Afficher le reste mun extraammo2 = LocalPlayer():GetAmmoCount( LocalPlayer():GetActiveWeapon():GetSecondaryAmmoType() ) draw.RoundedBox(0, ScrW() -160, ScrH()-60, 150, 50, Color(0,0,0, 150)) -- Affiche box munitions draw.RoundedBox(0, ScrW() -160-5, ScrH()-60 -5, 160, 60, Color(0,0,0, 150)) -- Affiche contour box munitions draw.RoundedBox(0, ScrW() -80, ScrH()-60, 1, 50, Color(255,255,255, 150)) -- Affiche la separation end draw.DrawText( ammoinclip ,"dhud-font-1", ScrW() -125, ScrH() -52, Color( 255, 255, 255), TEXT_ALIGN_CENTER ) -- Affiche le nombre de munitions draw.DrawText( extraammo , "dhud-font-1", ScrW() -45, ScrH() -52, Color( 255, 255, 255), TEXT_ALIGN_CENTER) -- Affiche le nombre dans le chargeur end
end)
-- Retirer le HUD de base
hook.Add( "HUDShouldDraw", "DefautHUD", function( name ) if ( name == "CHudHealth" or name == "CHudBattery" ) then return false end
end )

Merci
 
C

Cezaw

Nouveau né
Messages
24
Score réaction
1
Points
15
C'est le fait que tu te prend mal pour les compatibilités :(
 
  • Initiateur de la discussion
Deadman69330

Deadman69330

Psychopathe
Messages
2 289
Score réaction
309
Points
290
Cezaw à dit:
C'est le fait que tu te prend mal pour les compatibilités :(
?? C’est a dire ??
 
Discord d'entraide
Rejoignz-nous sur Discord