Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.41 KB | None | 0 0
  1.  
  2. concommand.Add("mybb_register", function( p, c, a )
  3. if !p then p = LocalPlayer() end
  4. DFrame1 = vgui.Create("DFrame")
  5. DFrame1:SetSize(186, 224)
  6. DFrame1:SetPos(ScrW() / 2 - 63, ScrH() / 2 - 112)
  7. DFrame1:SetTitle("Account Creation")
  8. DFrame1:SetSizable(true)
  9. DFrame1:SetDeleteOnClose(false)
  10. DFrame1:ShowCloseButton(false)
  11. DFrame1:MakePopup()
  12. DFrame1.Paint = function()
  13. draw.RoundedBox( 6, 0, 0, 186, 224, Color( 29, 36, 53, 255 ) )
  14. end
  15.  
  16. local DImage9 = vgui.Create("DImageButton", DFrame1)
  17. DImage9:SetSize(16, 16)
  18. DImage9:SetPos(164, 4)
  19. DImage9:SetImage( "gui/silkicons/folder_go" )
  20. DImage9:SetToolTip( "Already have an account?" )
  21. DImage9:SizeToContents()
  22. DImage9.DoClick = function()
  23. DFrame1:Close()
  24. end
  25.  
  26. // Username
  27. local DLabel1 = vgui.Create("DLabel", DFrame1)
  28. DLabel1:SetPos(10, 30)
  29. DLabel1:SetText("Username")
  30. DLabel1:SizeToContents()
  31.  
  32. local DTextEntry1 = vgui.Create("DTextEntry", DFrame1)
  33. DTextEntry1:SetSize(125, 20)
  34. DTextEntry1:SetPos(30, 44)
  35. DTextEntry1:SetText("")
  36. DTextEntry1.Think = function( )
  37. local username = DTextEntry1:GetValue()
  38. if string.len(username) > 5 then
  39. DImage5:SetImage( "gui/silkicons/check_on" )
  40. end
  41. end
  42.  
  43. local DImage1 = vgui.Create("DImage", DFrame1)
  44. DImage1:SetSize(16, 16)
  45. DImage1:SetPos(10, 44)
  46. DImage1:SetImage("gui/silkicons/user")
  47. DImage1:SizeToContents()
  48.  
  49. DImage5 = vgui.Create("DImage", DFrame1)
  50. DImage5:SetSize(16, 16)
  51. DImage5:SetPos(160, 44)
  52. DImage5:SetImage( "gui/silkicons/check_off" )
  53. DImage5:SizeToContents()
  54.  
  55. // Password
  56. local DLabel2 = vgui.Create("DLabel", DFrame1)
  57. DLabel2:SetPos(10, 68)
  58. DLabel2:SetText("Password")
  59. DLabel2:SizeToContents()
  60.  
  61. local DTextEntry2 = vgui.Create("DTextEntry", DFrame1)
  62. DTextEntry2:SetSize(125, 20)
  63. DTextEntry2:SetPos(30, 83)
  64. DTextEntry2:SetText("")
  65. DTextEntry2.Think = function( )
  66. local password = DTextEntry2:GetValue()
  67. if string.len(password) > 5 then
  68. DImage6:SetImage( "gui/silkicons/check_on" )
  69. end
  70. end
  71.  
  72. local DImage2 = vgui.Create("DImage", DFrame1)
  73. DImage2:SetSize(16, 16)
  74. DImage2:SetPos(10, 83)
  75. DImage2:SetImage("gui/silkicons/shield")
  76. DImage2:SizeToContents()
  77.  
  78. DImage6 = vgui.Create("DImage", DFrame1)
  79. DImage6:SetSize(16, 16)
  80. DImage6:SetPos(160, 83)
  81. DImage6:SetImage( "gui/silkicons/check_off" )
  82. DImage6:SizeToContents()
  83.  
  84. // Email
  85. local DLabel3 = vgui.Create("DLabel", DFrame1)
  86. DLabel3:SetPos(10, 110)
  87. DLabel3:SetText("Email")
  88. DLabel3:SizeToContents()
  89.  
  90. local DTextEntry3 = vgui.Create("DTextEntry", DFrame1)
  91. DTextEntry3:SetSize(125, 20)
  92. DTextEntry3:SetPos(30, 125)
  93. DTextEntry3:SetText("")
  94. DTextEntry3.Think = function( )
  95. local email = DTextEntry3:GetValue()
  96. if string.len(email) > 8 then
  97. DImage7:SetImage( "gui/silkicons/check_on" )
  98. end
  99. end
  100.  
  101. local DImage3 = vgui.Create("DImage", DFrame1)
  102. DImage3:SetSize(16, 16)
  103. DImage3:SetPos(10, 125)
  104. DImage3:SetImage("gui/silkicons/world")
  105. DImage3:SizeToContents()
  106.  
  107. DImage7 = vgui.Create("DImage", DFrame1)
  108. DImage7:SetSize(16, 16)
  109. DImage7:SetPos(160, 127)
  110. DImage7:SetImage( "gui/silkicons/check_off" )
  111. DImage7:SizeToContents()
  112.  
  113. // Roleplay Name
  114. local DLabel4 = vgui.Create("DLabel", DFrame1)
  115. DLabel4:SetPos(10, 151)
  116. DLabel4:SetText("Roleplay Name")
  117. DLabel4:SizeToContents()
  118.  
  119. local DTextEntry4 = vgui.Create("DTextEntry", DFrame1)
  120. DTextEntry4:SetSize(125, 20)
  121. DTextEntry4:SetPos(32, 168)
  122. DTextEntry4:SetText("")
  123. DTextEntry4.Think = function( )
  124. local rpname = DTextEntry4:GetValue()
  125. if string.len(rpname) > 5 then
  126. DImage8:SetImage( "gui/silkicons/check_on" )
  127. end
  128. end
  129.  
  130. local DImage4 = vgui.Create("DImage", DFrame1)
  131. DImage4:SetSize(16, 16)
  132. DImage4:SetPos(10, 168)
  133. DImage4:SetImage("gui/silkicons/group")
  134. DImage4:SizeToContents()
  135.  
  136. DImage8 = vgui.Create("DImage", DFrame1)
  137. DImage8:SetSize(16, 16)
  138. DImage8:SetPos(160, 168)
  139. DImage8:SetImage( "gui/silkicons/check_off" )
  140. DImage8:SizeToContents()
  141.  
  142. // Submit
  143. local DButton1 = vgui.Create("DButton", DFrame1)
  144. DButton1:SetSize(70, 25)
  145. DButton1:SetPos(58, 194)
  146. DButton1:SetText("Submit")
  147. DButton1.Paint = function()
  148. draw.RoundedBox( 6, 0, 0, 186, 255, Color( 32, 40, 57, 255 ) )
  149. end
  150.  
  151. DButton1.DoClick = function()
  152. local username = DTextEntry1:GetValue()
  153. local password = DTextEntry2:GetValue()
  154. local email = DTextEntry3:GetValue()
  155. local rpname = DTextEntry4:GetValue()
  156. if !username or !password or !password2 or !email then return end
  157. if string.len(username) < 6 then DTextEntry1:SetTextColor( 255, 0, 0 ) p:ChatPrint("[MyBB] Your username has be 6 characters or more.") return end
  158. if string.len(password) < 6 then DTextEntry2:SetTextColor( 255, 0, 0 ) p:ChatPrint("[MyBB] Your password has be 6 characters or more.") return end
  159. if password != password2 < 6 then DTextEntry2:SetTextColor( 255, 0, 0 ) DTextEntry3:SetTextColor( 255, 0, 0 ) p:ChatPrint("[MyBB] Your passwords don't match.") return end
  160. if string.len(email) < 8 then DTextEntry4:SetTextColor( 255, 0, 0 ) p:ChatPrint("[MyBB] Your email has be 8 characters or more.") return end
  161. if string.len(rpname) < 6 then DTextEntry4:SetTextColor( 255, 0, 0 ) p:ChatPrint("[MyBB] Your RP Name has be 6 characters or more.") return end
  162. DFrame1:Close()
  163. p:RegisterUser( p:SteamID(), DTextEntry1:GetValue(), DTextEntry2:GetValue(), DTextEntry3:GetValue() )
  164. p:ConCommand("say", "/rpname " .. rpname)
  165. timer.Simple( 5, function( )
  166. p:GetUsersID( p:SteamID() )
  167. end)
  168. end
  169. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement