Abu-Solo Posted January 26, 2017 Share Posted January 26, 2017 ابغي كود تايمر لما اللاعب يضغط علي الزراريقفل الزرارguiSetEnabled+ يخلي الكلام حق الزرار كذاانتظر (5)انتظر (4)انتظر(3)انتظر(2)انتظر(1)وبعدها يفتح الزرار Link to comment
Adham Posted January 26, 2017 Share Posted January 26, 2017 (edited) علي حسب فهمي , "onClientGUIClick" guiSetEnabled -- false guiSetText setTimer guiSetEnabled -- true Edited January 26, 2017 by Deativated 1 Link to comment
' A F . Posted January 26, 2017 Share Posted January 26, 2017 setTimer isTimer getTimerDetails math.floor guiSetText 1 Link to comment
Abu-Solo Posted January 26, 2017 Author Share Posted January 26, 2017 2 minutes ago, Default said: setTimer isTimer getTimerDetails math.floor guiSetText ي ليت الكود كامل فيه math.floor ماني فاهمله شئ Link to comment
Me[Z]oO Posted January 26, 2017 Share Posted January 26, 2017 function guiAntiFlood(element, timer) if getElementType ( element ) == "gui-button" then local atimer = tonumber(timer) if atimer == nil or atimer == '' or not tonumber(atimer) then error("Bad Argument the Argument 2 must number") else end guiSetEnabled(element,false) setTimer(function() guiSetEnabled(element,true) end,tonumber(atimer),1) else error("Bad Argument 1 the element must button") end end button = guiCreateButton( 0.7, 0.1, 0.2, 0.1, "Abu-Solo!", true ) function mezo () guiAntiFlood(button, 5000) setTimer( guiSetText, 1000, 1,button,'انتظر 1') setTimer( guiSetText, 2000, 1,button,'انتظر 2') setTimer( guiSetText, 3000, 1,button,'انتظر 3') setTimer( guiSetText, 4000, 1,button,'انتظر 4') setTimer( guiSetText, 5000, 1,button,'انتظر 5') setTimer( guiSetText, 6000, 1,button,'Abu-Solo') end addEventHandler ( "onClientGUIClick", button, mezo ) طريقة مبسطة لك في طرق اخري بس جرب ذي وخلاص 1 Link to comment
Abu-Solo Posted January 26, 2017 Author Share Posted January 26, 2017 3 minutes ago, Me[Z]oO said: function guiAntiFlood(element, timer) if getElementType ( element ) == "gui-button" then local atimer = tonumber(timer) if atimer == nil or atimer == '' or not tonumber(atimer) then error("Bad Argument the Argument 2 must number") else end guiSetEnabled(element,false) setTimer(function() guiSetEnabled(element,true) end,tonumber(atimer),1) else error("Bad Argument 1 the element must button") end end button = guiCreateButton( 0.7, 0.1, 0.2, 0.1, "Abu-Solo!", true ) function mezo () guiAntiFlood(button, 5000) setTimer( guiSetText, 1000, 1,button,'انتظر 1') setTimer( guiSetText, 2000, 1,button,'انتظر 2') setTimer( guiSetText, 3000, 1,button,'انتظر 3') setTimer( guiSetText, 4000, 1,button,'انتظر 4') setTimer( guiSetText, 5000, 1,button,'انتظر 5') setTimer( guiSetText, 6000, 1,button,'Abu-Solo') end addEventHandler ( "onClientGUIClick", button, mezo ) طريقة مبسطة لك في طرق اخري بس جرب ذي وخلاص يخربيتك افدتني فـ اقل من دقيقة مشكور ويعطيك العافية ما قصرت ي بطل مشكورين @Default @Me[Z]oO @Deativated Link to comment
Me[Z]oO Posted January 26, 2017 Share Posted January 26, 2017 1 minute ago, Abu-Solo said: يخربيتك افدتني فـ اقل من دقيقة مشكور ويعطيك العافية ما قصرت ي بطل مشكورين @Default @Me[Z]oO @Deativated الله يعافيك 1 Link to comment
Abu-Solo Posted January 26, 2017 Author Share Posted January 26, 2017 1 minute ago, Me[Z]oO said: الله يعافيك انا داري اني اقدر أسويها بـ setTimer بس حبيت آعرف كيف أسويها بدون setText اذا فيه طرق ثانية بـ أكون مشكور Link to comment
^iiEcoo'x_) Posted January 26, 2017 Share Posted January 26, 2017 في طريقة اخرى بس م ادري وش فايدتها guiCreateButton -- صناعة زر 1 setTimer -- وقت مثلا كل 1 دقيقة isElement -- التحقق من الامنت اذا موجود "الالمنت" هو الزر destroyElement -- حذف الزر guiCreateButton -- صناعة زر رقم 2 2 Link to comment
Abu-Solo Posted January 26, 2017 Author Share Posted January 26, 2017 Just now, #_iMr,[E]coo said: في طريقة اخرى بس م ادري وش فايدتها guiCreateButton -- صناعة زر 1 setTimer -- وقت مثلا كل 1 دقيقة isElement -- التحقق من الامنت اذا موجود "الالمنت" هو الزر destroyElement -- حذف الزر guiCreateButton -- صناعة زر رقم 2 يعطيك العافية Link to comment
Abdul KariM Posted January 27, 2017 Share Posted January 27, 2017 فيه طريقة اسهل من هذا سوي متغير وخلي قيمته 5 واذا ضغط زر يبدأ تايمر وينقص من المتغير واحد واذا المتغير يساوي الصفر تفتح له الزر احسن من المشورة الي اشوفها فوق 1 Link to comment
Abu-Solo Posted January 27, 2017 Author Share Posted January 27, 2017 Example: ? 56 minutes ago, Abdul KariM said: فيه طريقة اسهل من هذا سوي متغير وخلي قيمته 5 واذا ضغط زر يبدأ تايمر وينقص من المتغير واحد واذا المتغير يساوي الصفر تفتح له الزر احسن من المشورة الي اشوفها فوق Link to comment
Abdul KariM Posted January 27, 2017 Share Posted January 27, 2017 بأسم الزر الي عندك aButton بدل local aButtonNum = 5 addEventHandler("onClientGUIClick",root, function ( ) if ( source == aButton ) then if ( isTimer ( aTimer ) ) then return end guiSetEnabled ( aButton , false ) guiSetText ( aButton , "please wait " .. tostring ( aButtonNum ) ) aTimer = setTimer ( function ( ) if ( aButtonNum <= 0 ) then guiSetEnabled ( aButton , true ) guiSetText ( aButton , "Click Here ..." ) if ( isTimer ( aTimer ) ) then killTimer ( aTimer ) end aButtonNum = 5 else aButtonNum = aButtonNum - 1 guiSetText ( aButton , "please wait " .. tostring ( aButtonNum ) ) end end , 1000 , 0 ) end end ) ; 1 Link to comment
Abu-Solo Posted January 27, 2017 Author Share Posted January 27, 2017 17 minutes ago, Abdul KariM said: بأسم الزر الي عندك aButton بدل local aButtonNum = 5 addEventHandler("onClientGUIClick",root, function ( ) if ( source == aButton ) then if ( isTimer ( aTimer ) ) then return end guiSetEnabled ( aButton , false ) guiSetText ( aButton , "please wait " .. tostring ( aButtonNum ) ) aTimer = setTimer ( function ( ) if ( aButtonNum <= 0 ) then guiSetEnabled ( aButton , true ) guiSetText ( aButton , "Click Here ..." ) if ( isTimer ( aTimer ) ) then killTimer ( aTimer ) end aButtonNum = 5 else aButtonNum = aButtonNum - 1 guiSetText ( aButton , "please wait " .. tostring ( aButtonNum ) ) end end , 1000 , 0 ) end end ) ; كفو ي بطل مشكور علي المساعده 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