iiv03 Posted April 2, 2019 Share Posted April 2, 2019 (edited) وش حل شباب local sx, sy = guiGetScreenSize() sx, sy = ( sx / 1280 ), ( sy / 720 ) local alpha = 100 local fadeSpeed = 5 addEventHandler("onClientRender", getRootElement(), function() if getKeyState("tab") then if alpha ~= 0 then alpha = alpha + fadeSpeed end dxDrawRectangle(241*sx, 212*sy, 799*sx, 70*sy, tocolor(0, 254, 144,alpha)) dxDrawRectangle(241*sx, 282*sy, 799*sx, 232*sy, tocolor(0, 0, 0,alpha)) end if alpha <= 0 then alpha = alpha - fadeSpeed end end ) صممت سكور بورد و ضفته له فتح + فانكشن حق فيد ان/اوت اللوحه تفتح عادي بس ليش لما ابقى ضاغط علي تاب تفتح وتفتح مره ثانيه؟ شو سالفه حل تكفون انقهرت منه والله Edited April 2, 2019 by liwahadri Link to comment
Master_MTA Posted April 2, 2019 Share Posted April 2, 2019 (edited) 19 minutes ago, liwahadri said: انقهرت من اللي فهمته local sx, sy = guiGetScreenSize() sx, sy = ( sx / 1280 ), ( sy / 720 ) local alpha = 0 local fadeSpeed = 4 addEventHandler("onClientRender", getRootElement(), function() alpha = alpha + fadeSpeed if alpha >= 255 then alpha =255 end if getKeyState("tab") then dxDrawRectangle(241*sx, 212*sy, 799*sx, 70*sy, tocolor(0, 254, 144,alpha)) dxDrawRectangle(241*sx, 282*sy, 799*sx, 232*sy, tocolor(0, 0, 0,alpha)) end end ) Edited April 2, 2019 by Master_MTA Link to comment
iiv03 Posted April 2, 2019 Author Share Posted April 2, 2019 Just now, Master_MTA said: من اللي فهمته local sx, sy = guiGetScreenSize() sx, sy = ( sx / 1280 ), ( sy / 720 ) local alpha = 0 local fadeSpeed = 4 addEventHandler("onClientRender", getRootElement(), function() alpha = alpha + fadeSpeed if alpha >= 255 then alpha =255 end if getKeyState("tab") then if alpha ~= 100 then alpha = alpha + fadeSpeed end dxDrawRectangle(241*sx, 212*sy, 799*sx, 70*sy, tocolor(0, 254, 144,alpha)) dxDrawRectangle(241*sx, 282*sy, 799*sx, 232*sy, tocolor(0, 0, 0,alpha)) end end ) مب كذا الي قصدي انا لو ضغطت علي التاب عشان تفتح سكور بورد اللوحه تفتح وتعيد وتفتح وتعيد نفس شيئ Link to comment
Master_MTA Posted April 2, 2019 Share Posted April 2, 2019 1 minute ago, liwahadri said: وتعيد معليش مب فاهم وضح +عدلت شي بالكود شيك عليه Link to comment
iiv03 Posted April 2, 2019 Author Share Posted April 2, 2019 Just now, Master_MTA said: معليش مب فاهم وضح fade in / outوال bind key انت تعرف سكور بورد الي بسرفرات ؟ اكيد يب اوك انا صممت لوحه سكور بورد ضفته له فانكشن fade in المشكله اللي صارت لي حين انه لما تدوس علي التاب تضل تفتح سكور بورد علي بس المشكله انه تضل هيك تفتح كانه معلق Link to comment
Master_MTA Posted April 2, 2019 Share Posted April 2, 2019 2 minutes ago, liwahadri said: key ورني الفنكشن bindkey Link to comment
iiv03 Posted April 2, 2019 Author Share Posted April 2, 2019 Just now, Master_MTA said: ورني الفنكشن bindkey مافيه bindkey فيه بس if getKeyState("tab") then بس غلطت فوق لول Link to comment
Master_MTA Posted April 2, 2019 Share Posted April 2, 2019 (edited) local sx, sy = guiGetScreenSize() sx, sy = ( sx / 1280 ), ( sy / 720 ) local alpha = 0 local fadeSpeed = 4 function isEventHandlerAdded( sEventName, pElementAttachedTo, func ) if type( sEventName ) == 'string' and isElement( pElementAttachedTo ) and type( func ) == 'function' then local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo ) if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs( aAttachedFunctions ) do if v == func then return true end end end end return false end function drawscoreboard() alpha = alpha + fadeSpeed if alpha >= 255 then alpha =255 end dxDrawRectangle(241*sx, 212*sy, 799*sx, 70*sy, tocolor(0, 254, 144,alpha)) dxDrawRectangle(241*sx, 282*sy, 799*sx, 232*sy, tocolor(0, 0, 0,alpha)) end bindKey('tab','both',function(_,st) if st=='down' then if not isEventHandlerAdded("onClientRender", getRootElement(),drawscoreboard) then fadeSpeed = 4 alpha=0 addEventHandler("onClientRender", getRootElement(),drawscoreboard) end else if isEventHandlerAdded("onClientRender", getRootElement(),drawscoreboard) then removeEventHandler("onClientRender", getRootElement(),drawscoreboard) end end end) ما ادري بيزبط او لا لكن جرب Edited April 2, 2019 by Master_MTA Link to comment
iiv03 Posted April 2, 2019 Author Share Posted April 2, 2019 (edited) 27 minutes ago, Master_MTA said: local sx, sy = guiGetScreenSize() sx, sy = ( sx / 1280 ), ( sy / 720 ) local alpha = 0 local fadeSpeed = 4 function isEventHandlerAdded( sEventName, pElementAttachedTo, func ) if type( sEventName ) == 'string' and isElement( pElementAttachedTo ) and type( func ) == 'function' then local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo ) if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs( aAttachedFunctions ) do if v == func then return true end end end end return false end function drawscoreboard() alpha = alpha + fadeSpeed if alpha >= 255 then alpha =255 end dxDrawRectangle(241*sx, 212*sy, 799*sx, 70*sy, tocolor(0, 254, 144,alpha)) dxDrawRectangle(241*sx, 282*sy, 799*sx, 232*sy, tocolor(0, 0, 0,alpha)) end bindKey('tab','both',function(_,st) if st=='down' then if not isEventHandlerAdded("onClientRender", getRootElement(),drawscoreboard) then fadeSpeed = 4 alpha=0 addEventHandler("onClientRender", getRootElement(),drawscoreboard) end else if isEventHandlerAdded("onClientRender", getRootElement(),drawscoreboard) then removeEventHandler("onClientRender", getRootElement(),drawscoreboard) end end end) ما ادري بيزبط او لا لكن جرب fade out ?زبط بس لما تشيل صبعك علي التاب مايجي Edited April 2, 2019 by liwahadri Link to comment
Master_MTA Posted April 2, 2019 Share Posted April 2, 2019 (edited) 1 hour ago, liwahadri said: لما يب ما سويت فيد اوت انا +_+ انت فهمت الكونسبت المفروض تسوي الفيد اوت بنفسك hint: use setTimer and killTimer and isTimer Edited April 2, 2019 by Master_MTA 1 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