всем хай. народ помогите уже минут сорок ищу и всё равно в упор не вижу ошибки, а именно при нажатии кнопки Vhod.button не происходит вызов функции Vhod.proverka
пытался оформить в виде addEventHandler ( "onClientGUIClick", Vhod.button,function()
--код--
end)
эффект тот же. в чем может быть ошибка?
Vhod = {}
function dostupSimvol(stroka)
local tablSimvol={q,w,e,r,t,y,u,i,o,p,a,s,d,f,g,h,j,k,l,z,x,c,v,b,n,m,1,2,3,4,5,6,7,8,9,0}
local fl = true
for n, nl in pairs(stroka) do
for key, value in pairs(t) do
if nl == value then
fl = 0
break
end
end
if fl then
return 0
end
end
return 1
end
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()),function()
local X = 0.375
local Y = 0.375
local Width = 0.25
local Height = 0.12
Vhod.wdwLogin = guiCreateWindow(X, Y, Width, Height, "", true)
X = 0.13
Y = 0.1
Width = 0.8
Height = 0.35
Vhod.edtpas = guiCreateEdit(X, Y, Width, Height, "pasword", true, Vhod.wdwLogin)
Y = 0.55
Vhod.button = guiCreateButton( X, Y, Width, Height, "Войти", true,Vhod.wdwLogin )
guiEditSetMaxLength(Vhod.edtpas, 12)
guiSetVisible(Vhod.wdwLogin, false)
if (Vhod.wdwLogin == nil) then
outputChatBox("Возникла непредвиденная ошибка и GUI входа не был создан.")
end
end)
addEventHandler ( "onClientGUIClick", Vhod.button, Vhod.proverka)
function Vhod:proverka()
outputChatBox("1KNOPKAA!!!!")
if Vhod.type then
if Vhod.steupreg==1 then
if not dostupSimvol(txts) or string.len(txts)<=6 then
outputChatBox("Для пароля разрешено использовать только a-z и 0-9",source)
outputChatBox("Длина не менее 6 символов!",source)
else
Vhod.pasword=guiGetText(Vhod.edtpas)
Vhod.steupreg =2
outputChatBox("Регистрация шаг:"..Vhod.steupreg)
guiSetText (Vhod.edtpas)
end
elseif Vhod.steupreg==2 then
Vhod.emeil=guiGetText(Vhod.edtpas,"email")
triggerServerEvent ( "reg", getRootElement(),guiGetText (Vhod.pasword,Vhod.emeil))
end
else
triggerServerEvent ( "avt", getRootElement(),guiGetText (Vhod.edtpas))
showCursor(false)
guiSetInputEnabled(false)
guiSetVisible(Vhod.wdwLogin,false)
end
end
addEvent("VIS_LR",true)
addEventHandler("VIS_LR",root,function(TYPEWindow)
Vhod.type = TYPEWindow
Vhod.steupreg=1
if TYPEWindow then
outputChatBox("Регистрация шаг:"..Vhod.steupreg)
guiSetText ( Vhod.button, "Дальше" )
end
guiSetVisible(Vhod.wdwLogin, true)
showCursor(true)
guiSetInputEnabled(true)
end)