Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //CLIENTSIDE
- net.Receive("POIP_NameMenu", function()
- local backboard = vgui.Create("DFrame")
- backboard:SetSize(350, 350)
- backboard:Center()
- backboard:ShowCloseButton(false)
- backboard:SetTitle("Name!")
- backboard:MakePopup()
- local nameprompt = vgui.Create("DLabel", backboard)
- nameprompt:SetText([[ Welcome to the server!
- In order to play properly, you need
- an RP name. Pick a proper RP name,
- or else you may be banned!]])
- nameprompt:SetFont("HUDHintTextLarge")
- nameprompt:SizeToContents()
- nameprompt:SetPos(50, 90)
- local firstnamebox = vgui.Create("DTextEntry", backboard)
- firstnamebox:SetPos( 35, 220 )
- firstnamebox:SetSize( 275, 25 )
- firstnamebox:SetText( "First Name" )
- local lastnamebox = vgui.Create("DTextEntry", backboard)
- lastnamebox:SetPos( 35, 255 )
- lastnamebox:SetSize( 275, 25 )
- lastnamebox:SetText( "Last Name" )
- local acceptname = vgui.Create("DButton", backboard)
- acceptname:SetPos( 15, 305 )
- acceptname:SetText( "Accept Name." )
- acceptname:SetSize( 320, 30 )
- acceptname.DoClick = function()
- if (firstnamebox:GetValue() == "" or lastnamebox:GetValue() == "" or !firstnamebox:GetValue() or !lastnamebox:GetValue()) then
- LocalPlayer():Notify("You need a name! Try again.", 3)
- return
- end
- local name = firstnamebox:GetValue().." "..lastnamebox:GetValue()
- if string.len(name) > 28 then
- LocalPlayer():Notify("That name is too long. Pick another one.", 3)
- return
- end
- net.Start("POIP_NameChange")
- net.WriteString(name)
- net.SendToServer()
- backboard:Close()
- end
- end)
- //SERVERSIDE
- net.Receive("POIP_NameChange", function(_, ply)
- local to = net.ReadString()
- POIP_ChangeName(ply, to) //obviously change this to whatever your name changing function is.
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement