- Initiateur de la discussion
Luciano Leggio
Geek suprême
- Messages
- 702
- Score réaction
- 141
- Points
- 120
Bonjour, j'ai récemment décidé de créer un HUD pour mon serveur.. J'ai suivis plusieurs tuto sur YouTube mais une erreur lua apparaît.
Voici mon code
Merci de votre aide bonne journée
Code:
[ERROR] lua/erosium_hud.lua:51: ')' expected near 'ScrH' 1. unknown - lua/erosium_hud.lua:0
Code:
surface.CreateFont( "Ero-1", { font = "Arial", extended = false, size = 13, weight = 500, blursize = 0, scanlines = 0, antialias = true, underline = false, italic = false, strikeout = false, symbol = false, rotary = false, shadow = false, additive = false, outline = false,
} )
surface.CreateFont( "Ero-2", { font = "Arial", extended = false, size = 30, weight = 500, blursize = 0, scanlines = 0, antialias = true, underline = false, italic = false, strikeout = false, symbol = false, rotary = false, shadow = false, additive = false, outline = false,
} )
hook.Add("HUDPaint", "HUD ERO", function() local function DisplayNotify(msg) local txt = msg:ReadString() GAMEMODE:AddNotify(txt, msg:ReadShort (), msg: ReadShort()) surface.PlaySound("buttons/lightswitch2.wav") MsgC(Color(255, 20, 20, 255), "[Zaref] ", Color(200, 200, 200, 255), txt, "\n")
end usermessage.Hook("_Notify", DisplayNotify)
local health = LocalPlayer():Health()
local armor = LocalPlayer () :Armor()
local job = teamGetName(LocalPlayer():Team() )
local money = LocalPlayer():GetDarkRPVar ("money")
local name = LocalPlayer() :Name()
draw.RoundedBox(4, 6 ScrH() - 20, 308, 18 Color(0,0,0,255))
draw.RoundedBox(4, 6 ScrH() - 43, 308, 18 Color(0,0,0,255))
draw.RoundedBox(4, 10 ScrH() - 20, health * 2, 14, Color(189,24,24,255))
draw.RoundedBox(4, 10 ScrH() - 41, armor * 2, 14, Color(29, 36, 127))
draw.simpleText (health, "Ero-1", 150, ScrH() - 21, Color(255,255,255,255))
draw.simpleText (armor, "Ero-1", 150, ScrH() - 44, Color(255,255,255,255))
draw.simpleText (job, "Ero-2", 150, ScrH() - 250, Color(255,255,255,255))
draw.simpleText (money.." D", "Ero-2", 150, ScrH() - 250, Color(255,255,255,255))
draw.simpleText (name, "Ero-2", 150, ScrH() - 600, Color(255,255,255,255))
hook.Add( "HUDShouldDraw", "DefautHUD", function( name ) if ( name == "CHudHealth" or name == "CHudBattery" ) then return false end
end )