View difference between Paste ID: Lsfrr3SV and kcc06xzU
SHOW: | | - or go back to the newest paste.
1
addEvent("registerAccount",true)
2-
--Server
2+
addEventHandler("registerAccount",getRootElement(), function(username,pw1)
3
	if getAccount(username) then
4
		logIn(getAccount(username),username,pw1)
5-
addEventHandler("registerAccount",getRootElement(),
5+
6-
function(username,pw1)
6+
	else
7-
if getAccount(username) then
7+
		addAccount(username,pw1)
8-
logIn(username,username,pw1)
8+
		logIn(getAccount(username),username,pw1)
9-
else
9+
	end
10-
addAccount(username,pw1)
10+
11-
logIn(username,username,pw1)
11+
12
13
----
14
--client
15
----
16
local kacke = false
17
local username = getPlayerName(getLocalPlayer())
18
local screenW, screenH = guiGetScreenSize()
19
20
addCommandHandler("test", function()
21
	if (kacke == false) then
22
		kacke = true
23-
addCommandHandler("test",
23+
		showCursor(true)
24-
function()
24+
	else
25-
if (kacke == false) then
25+
		kacke = false
26-
kacke = true
26+
		showCursor(false)
27-
showCursor(true)
27+
	end
28-
else
28+
29-
kacke = false
29+
30-
showCursor(false)
30+
addEventHandler("onClientResourceStart",getRootElement(), function()
31
	showCursor(true)
32
	accept = guiCreateButton((screenW - 192) / 2, (screenH - 47) / 1.4, 192, 47, "Accept", false)
33
	guiSetProperty(accept, "NormalTextColour", "FFAAAAAA")
34
	password1 = guiCreateEdit((screenW - 291) / 2, (screenH - 37) / 1.8, 291, 37, "", false)
35-
addEventHandler("onClientResourceStart",getRootElement(),
35+
	guiEditSetMasked(password1, true)
36-
function()
36+
	password2 = guiCreateEdit((screenW - 291) / 2, (screenH - 37) / 1.6, 291, 37, "", false)
37-
showCursor(true)
37+
	guiEditSetMasked(password2, true)
38-
accept = guiCreateButton((screenW - 192) / 2, (screenH - 47) / 1.4, 192, 47, "Accept", false)
38+
	local pw1 = guiGetText(password1)
39-
		guiSetProperty(accept, "NormalTextColour", "FFAAAAAA")
39+
	local pw2 = guiGetText(password2)
40-
		password1 = guiCreateEdit((screenW - 291) / 2, (screenH - 37) / 1.8, 291, 37, "", false)
40+
	addEventHandler("onClientGUIClick",accept,accepted,false)
41-
		guiEditSetMasked(password1, true)
41+
42-
		password2 = guiCreateEdit((screenW - 291) / 2, (screenH - 37) / 1.6, 291, 37, "", false)
42+
43-
		guiEditSetMasked(password2, true)
43+
44-
		local pw1 = guiGetText(password1)
44+
45-
		local pw2 = guiGetText(password2)
45+
46-
		addEventHandler("onClientGUIClick",accept,accepted,false)
46+
47
        dxDrawText("Login/Register", (screenW - 364) / 2, (screenH - 45) / 3.5, ((screenW - 364) / 2) + 364, ( (screenH - 45) / 3.5) + 45, tocolor(249, 0, 0, 163), 1, "bankgothic", "left", "top", false, false, false, false, false)
48
        dxDrawText("Your Name", (screenW - 190) / 2, (screenH - 30) / 2.8, ((screenW - 190) / 2) + 190, ( (screenH - 30) / 2.8) + 30, tocolor(249, 0, 0, 163), 1, "bankgothic", "left", "top", false, false, false, false, false)
49
        dxDrawText(username, (screenW - 198) / 2, (screenH - 36) / 2.5, ((screenW - 198) / 2) + 198, ( (screenH - 36) / 2.5) + 36, tocolor(255, 255, 255, 255), 1, "bankgothic", "left", "top", false, false, false, false, false)
50
        dxDrawText("Password", (screenW - 190) / 2, (screenH - 30) / 2, ((screenW - 190) / 2) + 190, ( (screenH - 30) / 2) + 30, tocolor(249, 0, 0, 163), 1, "bankgothic", "left", "top", false, false, false, false, false)
51
   end
52
--end
53
)
54
55
function accepted()
56
	if (pw1 == pw2) then
57
		acceptedlogin()
58
	else
59
		outputChatBox("Deine Passwörter stimmen nicht überein!",255,0,0)
60
	end
61
end
62-
if (pw1 == pw2) then
62+
63-
acceptedlogin()
63+
64-
else
64+
	triggerServerEvent("registerAccount",getLocalPlayer(),username,pw1)
65-
outputChatBox("Deine Passwörter stimmen nicht überein!",255,0,0)
65+