p1kas Posted August 14, 2020 Share Posted August 14, 2020 Есть кнопка в виде прямоугольника: local buttonAuth_round = dgs:dgsCreateRoundRect(30,false,tocolor(62,153,247)) local buttonAuth = dgs:dgsCreateImage(182,0,164,56,buttonAuth_round,false,loginButtons,tocolor(62,153,247)) local buttonAuth_text = dgs:dgsCreateLabel(57,18,50,20,'Войти', false, buttonAuth) Есть обработчик: addEventHandler("onDgsMouseClick", buttonAuth, function() local login, password = dgs:dgsGetText(inputLogin_edit), dgs:dgsGetText(inputPass_edit) if not string.find(login, "%S") then return end if not string.find(password, "%S") then return end triggerServerEvent("playerLogin", getLocalPlayer(), login, password) end, false) Но при нажатии на кнопку или любой другой dgs элемент (который обрабатывается) — срабатывает два раза (одновременно), как это можно исправить? Link to comment
Moderators Patrick Posted August 14, 2020 Moderators Share Posted August 14, 2020 Wrong language, moved to Russian section. Link to comment
K1parik Posted August 15, 2020 Share Posted August 15, 2020 https://wiki.multitheftauto.com/wiki/OnDgsMouseClick первый раз срабатывает при нажатии кнопки. второй раз при отпускании кнопки Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now