Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include( 'shared.lua' )
- function ShowTeamMenu()
- local XPos = (surface.ScreenWidth() / 2) - 250
- local YPos = (surface.ScreenHeight() / 2) - 100
- local DermaPanel = vgui.Create( "DFrame" )
- DermaPanel:SetPos( XPos,YPos )
- DermaPanel:SetSize( 500,250 )
- DermaPanel:SetTitle( "Choose Your Team, Maggot" ) // Name of Fram
- DermaPanel:SetVisible( true )
- DermaPanel:SetDraggable( true ) //Can the player drag the frame /True/False
- DermaPanel:ShowCloseButton( false ) //Show the X (Close button) /True/False
- DermaPanel:MakePopup()
- local DermaButton = vgui.Create( "DButton" )
- DermaButton:SetParent( DermaPanel ) // Set parent to our "DermaPanel"
- DermaButton:SetText( "Team 1" )
- DermaButton:SetPos( 25, 50 )
- DermaButton:SetSize( 150, 50 )
- DermaButton.DoClick = function ()
- RunConsoleCommand("team_1")
- LocalPlayer():ChatPrint("You are now on Team 1")
- end
- local DermaButton = vgui.Create( "DButton" )
- DermaButton:SetParent( DermaPanel ) // Set parent to our "DermaPanel"
- DermaButton:SetText( "Team 2" )
- DermaButton:SetPos( 325, 50 )
- DermaButton:SetSize( 150, 50 )
- DermaButton.DoClick = function ()
- RunConsoleCommand( "kill" ) // What happens when you press the button
- end
- local DermaButton = vgui.Create( "DButton" )
- DermaButton:SetParent( DermaPanel ) // Set parent to our "DermaPanel"
- DermaButton:SetText( "Team 3" )
- DermaButton:SetPos( 25, 150 )
- DermaButton:SetSize( 150, 50 )
- DermaButton.DoClick = function ()
- RunConsoleCommand( "kill" ) // What happens when you press the button
- end
- local DermaButton = vgui.Create( "DButton" )
- DermaButton:SetParent( DermaPanel ) // Set parent to our "DermaPanel"
- DermaButton:SetText( "Team 4" )
- DermaButton:SetPos( 325, 150 )
- DermaButton:SetSize( 150, 50 )
- DermaButton.DoClick = function ()
- RunConsoleCommand( "kill" ) // What happens when you press the button
- end
- end
- usermessage.Hook( "call_vgui", ShowTeamMenu )
Add Comment
Please, Sign In to add comment