local antySpam_tick; auth.clickButton = function( id ) if antySpam_tick and getTickCount() - antySpam_tick < 3000 then noti:alert('warning', 'Odczekaj chwilę przed nastepnym użyciem przycisku.') return end antySpam_tick = getTickCount(); if id == auth.gui['btn']['login'] then local text = {login=editbox:getEditboxText(auth.gui['eb']['login']), password=editbox:getEditboxText(auth.gui['eb']['password'])}; if text.login:len() < 3 then noti:alert('error', 'Login musi zawierać co najmniej 3 znaki.') return end if text.password:len() < 5 then noti:alert('error', 'Hasło musi zawierać co najmniej 5 znaków.') return end triggerServerEvent('loadAccount',resourceRoot, localPlayer, text.login, text.password) elseif id == auth.gui['btn']['register'] then local text = {login=editbox:getEditboxText(auth.gui['eb']['rlogin']), password=editbox:getEditboxText(auth.gui['eb']['rpassword']), password2=editbox:getEditboxText(auth.gui['eb']['rpassword2']), email=editbox:getEditboxText(auth.gui['eb']['email'])}; if text.login:len() < 3 then noti:alert('error', 'Login musi zawierać co najmniej 3 znaki.') return end if text.password:len() < 5 then noti:alert('error', 'Hasło musi zawierać co najmniej 5 znaków.') return end if not isValidMail(text.email) then noti:alert('error', 'Podany adres e-mail jest nieprawdiłowy.') return end if text.password ~= text.password2 then noti:alert('error', 'Podane hasła nie są identyczne.') return end triggerServerEvent('addAccount',resourceRoot, localPlayer, text.login, text.password, text.email) end end