function login_func ( player, username, password)
local query = dbQuery ( connect, "SELECT username, password FROM accounts WHERE username = ?", username )
if ( query ) then
local data, rows = dbPoll ( query, -1 )
if ( rows == 1 ) then
if ( data [ 1 ].password == password ) then
setElementData ( player, "LoggedIN", true )
outputChatBox ( "Du hast dich erfolgreich eingeloggt!",player, 0, 125, 0 )
outputChatBox ( "Willkommen zurück, "..string.gsub ( getPlayerName ( player ), '#%x%x%x%x%x%x', '' ), player, 0, 125, 0 )
triggerClientEvent ( player, "closeLoginPanel", player )
end
end
else
outputChatBox("Error 404 : Dein Benutzername oder dein Passwort ist falsch!",player,125,0,0)
end
end
addEvent ( "LoginRequest", true )
addEventHandler ( "LoginRequest", getRootElement(), login_func )
P.S: You should encrypt the passwords with sha256.