http://img15.hostingpics.net/pics/676446bug.png
Et voici le code (il est peut être pas mal désorganisé):
hook.Add("InitPostEntity", "DrawPlayerModel", function() -- must be in initpostentity or it will say its a null entity
iconmodel = vgui.Create("DModelPanel")
iconmodel:SetModel( LocalPlayer():GetModel())
function iconmodel:LayoutEntity( Entity ) return end
iconmodel:SetPos(20, ScrH() - 195)
iconmodel:SetAnimated(false)
iconmodel:SetSize(100,100)
iconmodel:SetCamPos( Vector( 14, -7, 63))
iconmodel:SetLookAt( Vector( 0, 0, 66.5 ) )
timer.Create("RefreshAvatar", 1, 0, function()
if LocalPlayer():GetModel() ~= iconmodel.Entity:GetModel() then
iconmodel:Remove()
iconmodel = vgui.Create("DModelPanel")
iconmodel:SetModel( LocalPlayer():GetModel())
function iconmodel:LayoutEntity( Entity ) return end
iconmodel:SetPos(150, ScrH() - 195)
iconmodel:SetAnimated(false)
iconmodel:SetSize(100,100)
iconmodel:SetCamPos( Vector( 14, -7, 63))
iconmodel:SetLookAt( Vector( 0, 0, 66.5 ) )
end
end)
end)
function myhud()
surface.SetDrawColor( Color( 255, 255, 255, 255 ) )
surface.DrawOutlinedRect( 19, ScrH() - 186, 452, 112 )
surface.SetDrawColor( Color( 39, 45, 52, 255 ) )
surface.DrawRect( 20, ScrH() - 185, 450, 110 )
surface.SetDrawColor( Color( 28, 32, 36, 255 ) )
surface.DrawRect( 20, ScrH() - 185, 100, 110 )
end
hook.Add("HUDPaint", "myhud", myhud)