Guest User

Untitled

a guest
Mar 20th, 2021
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. local db = exports['rpg_db']
  2.  
  3. addEvent('login', true)
  4. addEventHandler('login', root, function(login, pass)
  5. local qq = string.format("SELECT * FROM authorize WHERE login=%s", login)
  6. local res = db:query(qq)
  7. if not res or #res<1 then
  8. outputChatBox('takie konto nie istnieje')
  9. return
  10. end
  11. if res[1].login == 0 then
  12. outputChatBox('takie konto nie istnieje')
  13. return
  14. end
  15. if res[1].pass ~= pass then
  16. outputChatBox('zle haslo')
  17. return
  18. end
  19. setElementData(client, "player:dbid", res[1].dbid)
  20. end)
  21.  
  22. addEvent('new', true)
  23. addEventHandler('new', root, function(login, pass)
  24. local qq = string.format('SELECT * FROM authorize WHERE login=%s', login)
  25. local res = db:query(qq)
  26. if res and #res>0 then
  27. outputChatBox('takie konto juz jest')
  28. return
  29. end
  30. qq = string.format('INSERT INTO authorize (login,pass) VALUES (%s, %s)', login, pass)
  31. db:execute(qq)
  32. outputChatBox('zrobiles konto')
  33. end)
Advertisement
Add Comment
Please, Sign In to add comment