Hello. I am currently creating a HUD for my DarkRP server. I am trying to draw the player model of the player in the HUD.
Does anyone know the best way to go about doing this? Thank you!
[CODE]
local plymodel = vgui.Create( "DModelPanel" )
plymodel:SetSize( 300, 300 )
plymodel:SetPos( 10, ScrH() - 310 )
function plymode:Think() --> This is so that the player model is checked every tick
plymodel:SetModel( LocalPlayer():GetModel() )
end
plymodel:SetCamPos( Vector( 0, 5, 62 ) )
plymodel:SetLookAt( Vector( 0, 5, 62 ) )
plymodel:ParentToHUD()
[/CODE]
You can play around with the numbers to your liking.
For more information visit:
[url]https://wiki.garrysmod.com/page/Category:DModelPanel[/url]
[QUOTE=Tupac;50091491][CODE]
local plymodel = vgui.Create( "DModelPanel" )
plymodel:SetSize( 300, 300 )
plymodel:SetPos( 10, ScrH() - 310 )
function plymode:Think() --> This is so that the player model is checked every tick
plymodel:SetModel( LocalPlayer():GetModel() )
end
plymodel:SetCamPos( Vector( 0, 5, 62 ) )
plymodel:SetLookAt( Vector( 0, 5, 62 ) )
plymodel:ParentToHUD()
[/CODE]
You can play around with the numbers to your liking.
For more information visit:
[url]https://wiki.garrysmod.com/page/Category:DModelPanel[/url][/QUOTE]
Thanks man!
[editline]8th April 2016[/editline]
[QUOTE=Tupac;50091491][CODE]
local plymodel = vgui.Create( "DModelPanel" )
plymodel:SetSize( 300, 300 )
plymodel:SetPos( 10, ScrH() - 310 )
function plymode:Think() --> This is so that the player model is checked every tick
plymodel:SetModel( LocalPlayer():GetModel() )
end
plymodel:SetCamPos( Vector( 0, 5, 62 ) )
plymodel:SetLookAt( Vector( 0, 5, 62 ) )
plymodel:ParentToHUD()
[/CODE]
You can play around with the numbers to your liking.
For more information visit:
[url]https://wiki.garrysmod.com/page/Category:DModelPanel[/url][/QUOTE]
Working great, but look at my latest thread :( [url]https://facepunch.com/showthread.php?t=1513882[/url]
Sorry, you need to Log In to post a reply to this thread.