Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- concommand.Add("mybb_register", function( p, c, a )
- if !p then p = LocalPlayer() end
- DFrame1 = vgui.Create("DFrame")
- DFrame1:SetSize(186, 224)
- DFrame1:SetPos(ScrW() / 2 - 63, ScrH() / 2 - 112)
- DFrame1:SetTitle("Account Creation")
- DFrame1:SetSizable(true)
- DFrame1:SetDeleteOnClose(false)
- DFrame1:ShowCloseButton(false)
- DFrame1:MakePopup()
- DFrame1.Paint = function()
- draw.RoundedBox( 6, 0, 0, 186, 224, Color( 29, 36, 53, 255 ) )
- end
- local DImage9 = vgui.Create("DImageButton", DFrame1)
- DImage9:SetSize(16, 16)
- DImage9:SetPos(164, 4)
- DImage9:SetImage( "gui/silkicons/folder_go" )
- DImage9:SetToolTip( "Already have an account?" )
- DImage9:SizeToContents()
- DImage9.DoClick = function()
- DFrame1:Close()
- end
- // Username
- local DLabel1 = vgui.Create("DLabel", DFrame1)
- DLabel1:SetPos(10, 30)
- DLabel1:SetText("Username")
- DLabel1:SizeToContents()
- local DTextEntry1 = vgui.Create("DTextEntry", DFrame1)
- DTextEntry1:SetSize(125, 20)
- DTextEntry1:SetPos(30, 44)
- DTextEntry1:SetText("")
- DTextEntry1.Think = function( )
- local username = DTextEntry1:GetValue()
- if string.len(username) > 5 then
- DImage5:SetImage( "gui/silkicons/check_on" )
- end
- end
- local DImage1 = vgui.Create("DImage", DFrame1)
- DImage1:SetSize(16, 16)
- DImage1:SetPos(10, 44)
- DImage1:SetImage("gui/silkicons/user")
- DImage1:SizeToContents()
- DImage5 = vgui.Create("DImage", DFrame1)
- DImage5:SetSize(16, 16)
- DImage5:SetPos(160, 44)
- DImage5:SetImage( "gui/silkicons/check_off" )
- DImage5:SizeToContents()
- // Password
- local DLabel2 = vgui.Create("DLabel", DFrame1)
- DLabel2:SetPos(10, 68)
- DLabel2:SetText("Password")
- DLabel2:SizeToContents()
- local DTextEntry2 = vgui.Create("DTextEntry", DFrame1)
- DTextEntry2:SetSize(125, 20)
- DTextEntry2:SetPos(30, 83)
- DTextEntry2:SetText("")
- DTextEntry2.Think = function( )
- local password = DTextEntry2:GetValue()
- if string.len(password) > 5 then
- DImage6:SetImage( "gui/silkicons/check_on" )
- end
- end
- local DImage2 = vgui.Create("DImage", DFrame1)
- DImage2:SetSize(16, 16)
- DImage2:SetPos(10, 83)
- DImage2:SetImage("gui/silkicons/shield")
- DImage2:SizeToContents()
- DImage6 = vgui.Create("DImage", DFrame1)
- DImage6:SetSize(16, 16)
- DImage6:SetPos(160, 83)
- DImage6:SetImage( "gui/silkicons/check_off" )
- DImage6:SizeToContents()
- // Email
- local DLabel3 = vgui.Create("DLabel", DFrame1)
- DLabel3:SetPos(10, 110)
- DLabel3:SetText("Email")
- DLabel3:SizeToContents()
- local DTextEntry3 = vgui.Create("DTextEntry", DFrame1)
- DTextEntry3:SetSize(125, 20)
- DTextEntry3:SetPos(30, 125)
- DTextEntry3:SetText("")
- DTextEntry3.Think = function( )
- local email = DTextEntry3:GetValue()
- if string.len(email) > 8 then
- DImage7:SetImage( "gui/silkicons/check_on" )
- end
- end
- local DImage3 = vgui.Create("DImage", DFrame1)
- DImage3:SetSize(16, 16)
- DImage3:SetPos(10, 125)
- DImage3:SetImage("gui/silkicons/world")
- DImage3:SizeToContents()
- DImage7 = vgui.Create("DImage", DFrame1)
- DImage7:SetSize(16, 16)
- DImage7:SetPos(160, 127)
- DImage7:SetImage( "gui/silkicons/check_off" )
- DImage7:SizeToContents()
- // Roleplay Name
- local DLabel4 = vgui.Create("DLabel", DFrame1)
- DLabel4:SetPos(10, 151)
- DLabel4:SetText("Roleplay Name")
- DLabel4:SizeToContents()
- local DTextEntry4 = vgui.Create("DTextEntry", DFrame1)
- DTextEntry4:SetSize(125, 20)
- DTextEntry4:SetPos(32, 168)
- DTextEntry4:SetText("")
- DTextEntry4.Think = function( )
- local rpname = DTextEntry4:GetValue()
- if string.len(rpname) > 5 then
- DImage8:SetImage( "gui/silkicons/check_on" )
- end
- end
- local DImage4 = vgui.Create("DImage", DFrame1)
- DImage4:SetSize(16, 16)
- DImage4:SetPos(10, 168)
- DImage4:SetImage("gui/silkicons/group")
- DImage4:SizeToContents()
- DImage8 = vgui.Create("DImage", DFrame1)
- DImage8:SetSize(16, 16)
- DImage8:SetPos(160, 168)
- DImage8:SetImage( "gui/silkicons/check_off" )
- DImage8:SizeToContents()
- // Submit
- local DButton1 = vgui.Create("DButton", DFrame1)
- DButton1:SetSize(70, 25)
- DButton1:SetPos(58, 194)
- DButton1:SetText("Submit")
- DButton1.Paint = function()
- draw.RoundedBox( 6, 0, 0, 186, 255, Color( 32, 40, 57, 255 ) )
- end
- DButton1.DoClick = function()
- local username = DTextEntry1:GetValue()
- local password = DTextEntry2:GetValue()
- local email = DTextEntry3:GetValue()
- local rpname = DTextEntry4:GetValue()
- if !username or !password or !password2 or !email then return end
- if string.len(username) < 6 then DTextEntry1:SetTextColor( 255, 0, 0 ) p:ChatPrint("[MyBB] Your username has be 6 characters or more.") return end
- if string.len(password) < 6 then DTextEntry2:SetTextColor( 255, 0, 0 ) p:ChatPrint("[MyBB] Your password has be 6 characters or more.") return end
- 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
- if string.len(email) < 8 then DTextEntry4:SetTextColor( 255, 0, 0 ) p:ChatPrint("[MyBB] Your email has be 8 characters or more.") return end
- 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
- DFrame1:Close()
- p:RegisterUser( p:SteamID(), DTextEntry1:GetValue(), DTextEntry2:GetValue(), DTextEntry3:GetValue() )
- p:ConCommand("say", "/rpname " .. rpname)
- timer.Simple( 5, function( )
- p:GetUsersID( p:SteamID() )
- end)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement