• Messaging problem and background blur.
    4 replies, posted
Alright, so i need some help with this code: [lua] local MyMenuTab3 = vgui.Create("DButton", MyMenuTab) MyMenuTab3:SetText("Read The MOTD") MyMenuTab3:SetSize(740,23) MyMenuTab3:SetPos(5,65) MyMenuTab3:SetSkin("DarkRP") CategoryList:AddItem( MyMenuTab3 ) MyMenuTab3.DoClick = function() local MessagePanel = vgui.Create( "DFrame" ) MessagePanel:SetPos( 250,250 ) MessagePanel:SetSize( 500, 50 ) MessagePanel:SetTitle( "Send a message to online admins." ) MessagePanel:ShowCloseButton( true ) MessagePanel:SetVisible( true ) MessagePanel:MakePopup() MessagePanel:SetBackgroundBlur( true ) local MessageText = vgui.Create( "DTextEntry", MessagePanel ) MessageText:SetPos( 20,25 ) MessageText:SetTall( 20 ) MessageText:SetWide( 450 ) MessageText:SetEnterAllowed( true ) MessageText.OnEnter = function() msg("say @ "..MessageText:GetValue().."" ) -- What happens when you press enter MessagePanel:SetVisible( false ) end[/lua] Alright so when im trying to setup the message to run the console command "say @", and add any additional text the player enters after that message, if you could explain to me how to do this that would be great. Also nevermind about the blur problem, i fixed it.
Try... [lua]LocalPlayer():ConCommand( "say @ \"".. MessageText:GetValue().."\"" ) OR RunConsoleCommand( "say", "@"..MessageText:GetValue() )[/lua]
[QUOTE=Aaron113;29952862]Try... [lua]LocalPlayer():ConCommand( "say @ \"".. MessageText:GetValue().."\"" ) OR RunConsoleCommand( "say", "@"..MessageText:GetValue() )[/lua][/QUOTE] LocalPlayer():ConCommand is depreciated. Always use RunConsoleCommand on the client.
Yes! Exactly what i was aiming for. Works great, thank you.
[QUOTE=Feihc;29952923]LocalPlayer():ConCommand is depreciated. Always use RunConsoleCommand on the client.[/QUOTE] Thanks, I didn't read the Additional Notes, and you're welcome zynga.
Sorry, you need to Log In to post a reply to this thread.