Jump to content

طلب كود ( تايمر ) لـ الزرار .


Abu-Solo

Recommended Posts

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 )

طريقة مبسطة لك في طرق اخري بس جرب ذي وخلاص

  • Like 1
Link to comment
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

في طريقة اخرى بس م ادري وش فايدتها

guiCreateButton -- صناعة زر 1 
setTimer -- وقت مثلا كل 1 دقيقة 
isElement -- التحقق من الامنت اذا موجود "الالمنت" هو الزر
destroyElement -- حذف الزر
guiCreateButton -- صناعة زر رقم 2 

 

  • Like 2
Link to comment
Just now, #_iMr,[E]coo said:

في طريقة اخرى بس م ادري وش فايدتها


guiCreateButton -- صناعة زر 1 
setTimer -- وقت مثلا كل 1 دقيقة 
isElement -- التحقق من الامنت اذا موجود "الالمنت" هو الزر
destroyElement -- حذف الزر
guiCreateButton -- صناعة زر رقم 2 

 

يعطيك العافية :D

Link to comment

Example: ? :D

56 minutes ago, Abdul KariM said:

فيه طريقة اسهل من هذا سوي متغير وخلي قيمته 5

واذا ضغط زر يبدأ تايمر وينقص من المتغير واحد

واذا المتغير يساوي الصفر تفتح له الزر احسن من المشورة الي اشوفها فوق

 

Link to comment

بأسم الزر الي عندك 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
	) ;

 

  • Like 1
Link to comment
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
	) ;

 

:shock::x:x

كفو ي بطل

مشكور علي المساعده

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...