• Help with DModelPanel.
    8 replies, posted
So I have this code: [CODE] teampickmenu_spec_model = vgui.Create( "DModelPanel", teampickmenu ) teampickmenu_spec_model:SetSize( ScrW() * 0.4, ScrH() * 0.8 ) teampickmenu_spec_model:SetPos(ScrW() * 0.025 + ScrW() * 0.4 + ScrW() * 0.05,ScrH() * 0.05) teampickmenu_spec_model:SetModel( "models/Humans/Group03/male_09.mdl" ) teampickmenu_spec_model.DoClick = function() teampickmenu:Close() end teampickmenu_spec_model:SetAnimated( true ) local teampickmenu_spec_model_animation = teampickmenu_spec_model:GetEntity():LookupSequence( "idle" ) teampickmenu_spec_model:GetEntity():SetSequence(teampickmenu_spec_model_animation) teampickmenu_spec_model.LayoutEntity = function( self ) self:RunAnimation() end [/CODE] But the menu won't show up and some of the code doesn't work, no errors.
What is the code for teampickmenu?
[QUOTE=MPan1;52337225]What is the code for teampickmenu?[/QUOTE] I'll give you the hole function if you ever wanted here: [CODE] net.Receive("bdm_openteammenu", function() local teampickmenu = vgui.Create("DFrame") teampickmenu:SetSize(ScrW() * 0.9, ScrH() * 0.9) teampickmenu:Center() teampickmenu:ShowCloseButton(false) teampickmenu:SetTitle("") teampickmenu:MakePopup() teampickmenu.Paint = function(self, w, h) Derma_DrawBackgroundBlur( self, 0.1 ) draw.RoundedBox( 0, 0, 0, w, h, Color( 0, 0, 0, 240 ) ) end teampickmenu_ply = vgui.Create("DButton", teampickmenu) teampickmenu_ply:SetSize(ScrW() * 0.4, ScrH() * 0.8) teampickmenu_ply:SetPos(ScrW() * 0.025,ScrH() * 0.05) teampickmenu_ply.DoClick = function() teampickmenu:Close() end teampickmenu_ply.Paint = function(self, w, h) if teampickmenu_ply:IsHovered() then draw.RoundedBox( 0, 0, 0, w, h, Color( 80, 200, 30, 120 )) else draw.RoundedBox( 0, 0, 0, w, h, Color( 60, 180, 10, 50 )) end end teampickmenu_ply:SetText("") teampickmenu_spec = vgui.Create("DButton", teampickmenu) teampickmenu_spec:SetSize(ScrW() * 0.4, ScrH() * 0.8) teampickmenu_spec:SetPos(ScrW() * 0.025 + ScrW() * 0.4 + ScrW() * 0.05,ScrH() * 0.05) teampickmenu_spec.Paint = function(self, w, h) if teampickmenu_spec_model:IsHovered() then draw.RoundedBox( 0, 0, 0, w, h, Color( 180, 180, 180, 120 )) else draw.RoundedBox( 0, 0, 0, w, h, Color( 160, 160, 160, 50 )) end end teampickmenu_spec:SetText("") teampickmenu_spec_model = vgui.Create( "DModelPanel", teampickmenu ) teampickmenu_spec_model:SetSize( ScrW() * 0.4, ScrH() * 0.8 ) teampickmenu_spec_model:SetPos(ScrW() * 0.025 + ScrW() * 0.4 + ScrW() * 0.05,ScrH() * 0.05) teampickmenu_spec_model:SetModel( "models/Humans/Group03/male_09.mdl" ) teampickmenu_spec_model.DoClick = function() teampickmenu:Close() end teampickmenu_spec_model:SetAnimated( true ) local teampickmenu_spec_model_animation = teampickmenu_spec_model:GetEntity():LookupSequence( "idle" ) teampickmenu_spec_model:GetEntity():SetSequence(teampickmenu_spec_model_animation) teampickmenu_spec_model.LayoutEntity = function( self ) self:RunAnimation() end end) [/CODE]
-- snip --
[QUOTE=davicyyo;52337249]-- snip --[/QUOTE] What?
Are you sure net.Receive is being called? Try printing something
[QUOTE=MPan1;52337327]Are you sure net.Receive is being called? Try printing something[/QUOTE] I don't know how and why but when I put the print() in a net.Receive() it crashed my game when loading.
Post code please
[QUOTE=MPan1;52339461]Post code please[/QUOTE] Oh... my bad... I deleted the DModelPanel with a better idea and I forgot that this thread existed. Closed.
Sorry, you need to Log In to post a reply to this thread.