Jump to content

شرح شئ


LOAM

Recommended Posts

aScreen_ , aVarB = { guiGetScreenSize ( ) } , true 

function StartCounter ( )
	if ( aVarB == true ) then 
		aVarB , aNumber , aBoolean , aRender = false , 20 , true , function ( )
			if ( aNumber > 0 ) then 
				if ( aBoolean == true ) then 
					aNumber , aBoolean = ( aNumber - 1 ) , false 
					setTimer ( function ( ) aBoolean = true end , 1000 , 1 )
				end
			else
				removeEventHandler ( 'onClientPreRender' , root , aRender )
				aVarB = true
			end 
			dxDrawText ( aNumber , ( aScreen_ [ 1 ] - 19 ) / 2 , ( aScreen_ [ 2 ] - 32 ) / 2 , ( ( aScreen_ [ 1 ] - 19 ) / 2 ) + 19 , ( ( aScreen_ [ 2 ] - 32 ) / 2 ) + 32 , tocolor ( 255 , 255 , 255 , 255 ), 1.00, 'pricedown' , 'left' , 'top', false, false, false, false, false)
		end
	addEventHandler ( 'onClientPreRender' , root , aRender )
	end
end

 

  • Like 1
Link to comment
14 hours ago, #Soking said:

aScreen_ , aVarB = { guiGetScreenSize ( ) } , true 

function StartCounter ( )
	if ( aVarB == true ) then 
		aVarB , aNumber , aBoolean , aRender = false , 20 , true , function ( )
			if ( aNumber > 0 ) then 
				if ( aBoolean == true ) then 
					aNumber , aBoolean = ( aNumber - 1 ) , false 
					setTimer ( function ( ) aBoolean = true end , 1000 , 1 )
				end
			else
				removeEventHandler ( 'onClientPreRender' , root , aRender )
				aVarB = true
			end 
			dxDrawText ( aNumber , ( aScreen_ [ 1 ] - 19 ) / 2 , ( aScreen_ [ 2 ] - 32 ) / 2 , ( ( aScreen_ [ 1 ] - 19 ) / 2 ) + 19 , ( ( aScreen_ [ 2 ] - 32 ) / 2 ) + 32 , tocolor ( 255 , 255 , 255 , 255 ), 1.00, 'pricedown' , 'left' , 'top', false, false, false, false, false)
		end
	addEventHandler ( 'onClientPreRender' , root , aRender )
	end
end

 

معلش أعرف ان الإفادة تمت بس أعطي طريقة ثانية :D

TimeToFinish = getTickCount() + 5000
inCounting = true

function StartCount()
   if inCounting then
    counting = math.ceil( (TimeToFinish - getTickCount()) /1000 )
     dxDrawText(counting, ..............)
      if counting == 0 then
      inCounting = false
    TimeToFinish = getTickCount()
   end
  end
end 
addEventHandler("onClientRender", root, StartCount)

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

رح يعد من 5 الى 0 :D

أي خطأ نبهوني لأني جوال

  • Like 1
Link to comment
42 minutes ago, #BrosS said:

معلش أعرف ان الإفادة تمت بس أعطي طريقة ثانية :D


TimeToFinish = getTickCount() + 5000
inCounting = true

function StartCount()
   if inCounting then
    counting = math.ceil( (TimeToFinish - getTickCount()) /1000 )
     dxDrawText(counting, ..............)
      if counting == 0 then
      inCounting = false
    TimeToFinish = getTickCount()
   end
  end
end 
addEventHandler("onClientRender", root, StartCount)

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

رح يعد من 5 الى 0 :D

أي خطأ نبهوني لأني جوال

شكرا جدا

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...