Advertisement
Guest User

my cl_init

a guest
Dec 7th, 2013
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. include("shared.lua")
  2. include("database/cl_database.lua")
  3.  
  4. function set_team()
  5.  
  6. local frame = vgui.Create( "DFrame" )
  7. frame:SetPos( ScrW() / 2, ScrH() / 2 ) --Set the window in the middle of the players screen/game window
  8. frame:SetSize( 300, 300 ) --Set the size
  9. frame:SetTitle( "Change Team" ) --Set title
  10. frame:SetVisible( true )
  11. frame:SetDraggable( false )
  12. frame:ShowCloseButton( true )
  13. frame:MakePopup()
  14.  
  15. team_1 = vgui.Create( "DButton", frame )
  16. team_1:SetPos( frame:GetTall() / 2, 5 ) --Place it half way on the tall and 5 units in horizontal
  17. team_1:SetSize( 50, 100 )
  18. team_1:SetText( "Runner" )
  19. team_1.DoClick = function() --Make the player join team 1
  20. RunConsoleCommand( "team_1" )
  21. end
  22.  
  23. team_2 = vgui.Create( "DButton", frame )
  24. team_2:SetPos( frame:GetTall() / 2, 105 ) --Place it next to our previous one
  25. team_2:SetSize( 50, 100 )
  26. team_2:SetText( "Shooter" )
  27. team_2.DoClick = function() --Make the player join team 2
  28. RunConsoleCommand( "team_2" )
  29. end
  30.  
  31. end
  32. concommand.Add( "team_menu", set_team )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement