Heii.
Hier mal meiner stes Login-Script:
ZitatAlles anzeigenfunction createLoginWindow()
local Width = 0.25
local Height = 0.25
wdwLogin = guiCreateWindow(X, Y, Width, Height, "Login", true)X = 0.0825
Y = 0.2
Width = 0.25
Height = 0.25
guiCreateLabel(X, Y, Width, Height, "Username", true, wdwLogin)
Y = 0.5
guiCreateKabel(X, Y, Width, Height, "Passwort", true, wdwLogin)X = 0.415
Y = 0.7
Widht = 0.25
Height = 0.2
btnLogin = guiCreateButton(X, Y, Width, Height, "Log In", true, wdwLogin)guiSetVisible(wdwLogin, false)
endaddEventHandler("onClientResourceStart", getResourceRootElement(getThisResource())
function ()
createLoginWindow()outputchatbox("Willkommen auf dem Server von Denninho und Sart. Du kannst dich nun einloggen.")
if (wdwLogin ~= nil) then
guiSetVisible(wdwLogin, true)
else
outputChatBox("An unexpected error has occurred and the log in GUI has not been created.")
end
showCursor(true)
guiSetInputEnabled(true)
end
)function createLoginWindow()
addEventHandler("onClientGUIClick", btnLogin, clientSubmitLogin, false)
function clientSubmitLogin(button,state)
if button == "left" and state == "up" then
guiSetInputEnabled(false)
guiSetVisible(wdwLogin, false)
showCursor(false)
end
endfunction clientSubmitLogin(button,state)
if button == "left" and state == "up" then
local username = guiGetText(edtUser)
local password = guiGetText(edtPass)if username and password then
triggerServerEvent("submitLogin", getRootElement(), username, password)
guiSetInputEnabled(false)
guiSetVisible(wdwLogin, false)
showCursor(false)
else
outputChatBox("Bitte trage dein Username und Passwort ein.")
end
end
endfunction loginHandler(username,password)
end
addevent("submitLogin",true)
addEventHandler("submitLogin",root,loginHandler)function loginHandler(username,password)
if username == "user" and password == "apple" then
if (client) then
spawnPlayer(Client, 1959.55, -1714.46, 10)
fadeCamera(client, true)
outputChatBox("Willkommen auf dem Server von Denninho und Sart. Das gesamte Adminteam wünscht dir viel Spaß!", client)
end
else
outputChatBox("Falscher Username und/oder Passwort. Versuche es bitte erneut.", client)
end
end
addEvent("submitLogin",true)
addEventHandler("submitLogin",root,loginHandler)
Wie mache ich dasnun das es beim einloggen im lokalen Server erscheint?