SalvadorMTA Posted December 22, 2018 Share Posted December 22, 2018 (edited) --Code : y = y + line_height elseif window.type == "button" then local line_height = line_height * 2 - 4 if not window.button then window.button = exports.dgs:dgsCreateButton( x + width / 4, y + 3, width / 2, line_height - 4, tostring( window.text ), false ) addEventHandler( "onClientElementDestroy", window.button, function( ) window.button = nil end, false ) if window.onClick then addEventHandler( "onClientGUIClick", window.button, function( button, state ) if state == "up" then if button == "left" then window.onClick( 1 ) elseif button == "right" then window.onClick( 2 ) end end end, false ) end if window.id then destroy[ window.id ] = window.button else table.insert( destroy, window.button ) end else local bx, by = exports.dgs:dgsGetPosition( window.button, false ) if by ~= y + 3 then exports.dgs:dgsSetPosition( window.button, bx, y + 3, false ) end end --Original code : y = y + line_height elseif window.type == "button" then local line_height = line_height * 2 - 4 if not window.button then window.button = guiCreateButton( x + width / 4, y + 3, width / 2, line_height - 4, tostring( window.text ), false ) addEventHandler( "onClientElementDestroy", window.button, function( ) window.button = nil end, false ) if window.onClick then addEventHandler( "onClientGUIClick", window.button, function( button, state ) if state == "up" then if button == "left" then window.onClick( 1 ) elseif button == "right" then window.onClick( 2 ) end end end, false ) end if window.id then destroy[ window.id ] = window.button else table.insert( destroy, window.button ) end else local bx, by = guiGetPosition( window.button, false ) if by ~= y + 3 then guiSetPosition( window.button, bx, y + 3, false ) end end ازرار لا تعمل يا شباب لي عرف خطأ لا يبخل علينا وشكرا Edited December 22, 2018 by SalvadorMTA . Link to comment
Berko Posted December 22, 2018 Share Posted December 22, 2018 (edited) استبدل onClientGUIClick بـ onDgsMouseClick ( القسم خطأ ) @N3xT Edited December 22, 2018 by Berko 1 Link to comment
SalvadorMTA Posted December 22, 2018 Author Share Posted December 22, 2018 Just now, Berko said: استبدل onClientGUIClick بـ onDgsMouseClick ( القسم خطأ ) @N3xT مشكور اشتغلوا 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