Ich weis leider nicht wie ich die Waffe in die Server: bekomme
und wie der befehl lauet das ich jemand eine Waffe geben kann.
Server:
Code:
function giveSMG( ply, cmd, args )
Funktion welche Spieler SMG gibt
end
concommand.Add|>( "givemesmg", giveSMG )
Client:
Code:
function TestVGUI( )
local Frame = vgui.Create( "Frame" );
Frame:SetSize( 200, 200 );
Frame:SetPos( 100, 100 );
Frame:SetVisible( true );
Frame:MakePopup( ); //Make the frame
Frame:PostMessage( "SetTitle", "text", "This is the title" );
local Button = vgui.Create( "Button", Frame );
Button:SetText( "SMG on" );
Button:SetPos( 30, 5 );
Button:SetWide( 100 );
function Button:DoClick()
RunConsoleCommand( "givemesmg" )
surface.PlaySound( "buttons/button15.wav" )
self:SetText( "SMG off" );
end
end
concommand.Add( "TestVGUI", TestVGUI );