Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- addEventHandler("onResourceStart", resourceRoot, function()
- local baza = "srv46618"
- local host = "80.72.41.210"
- local user = "srv46618"
- local pass = "moje_haslo"
- local db = dbConnect( "mysql", "dbname=srv46618;host=80.72.41.210", "user", "pass", "share=1" )
- end)
- addEvent("tryLogin", true)
- addEventHandler("tryLogin", resourceRoot, function(login,pass)
- local q = dbQuery(db, "SELECT * FROM users WHERE login=? AND pass=?", login, md5(pass))
- local w = dbPoll(q, -1)
- if w and #w > 0 then
- triggerClientEvent(client, "closePanel", resourceRoot)
- spawnPlayer(client, -2007.35291, 840.07355, 45.29688)
- setCameraTarget(client, client)
- outputChatBox("#cc0000»#0066cc» #fbfbfbWitaj na Life4u!", client, 255, 255, 255, true)
- setPlayerName(client, w[1].login)
- setPlayerMoney(client, w[1].money)
- setElementModel(client, w[1].skin)
- setElementData(client, "player:logged", true)
- setElementData(client, "player:id", w[1].id)
- else
- outputChatBox("#0066cc» #fbfbfbBłędny login lub hasło!", client, 255, 255, 255, true)
- end
- end)
- addEvent("tryRegister", true)
- addEventHandler("tryRegister", resourceRoot, function(login,pass)
- local q = dbQuery(db, "SELECT login FROM users WHERE login=?", login)
- local w = dbPoll(q, -1)
- if w and #w > 0 then
- outputChatBox("#0066cc» #fbfbfbIstnieje już konto o podanym loginie!", client, 255, 255, 255, true)
- else
- outputChatBox("#0066cc» #fbfbfbTwoje konto zostało pomyślnie założone!", client, 255, 255, 255, true)
- dbExec(db, "INSERT INTO users SET login=?, pass=?", login, md5(pass))
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement