Jump to content

×[مساعده]× getTickCount


iiv03

Recommended Posts

سلأم عليكم

معي مشكله ب كود هنا لما اسوي الريكتآنجل تتغير آرقام alpha

يعني مقصود من

0-255 -> 255-0

يعني كل ثانيه يسوي كذا ومايوقف

كود حقي

local tick = getTickCount()

    function test()

		local progress = math.min((getTickCount()-tick)/1500*1,1)
        dxDrawRectangle(416, 174, 498, 373, tocolor(0, 0, 0, 255*progress), false)
    end
	addEventHandler("onClientRender", root, test)

 

Edited by xFabel
Link to comment
10 minutes ago, #\_oskar_/# said:

math.min((getTickCount()-tick)/2000,tick ) -- عدد مفتوح 

or

math.min((getTickCount()-tick)/2000,10 ) -- العدد راح يكون 10 مرات

---- 

اذا في شئ ثاني تفضل قوله

آلحين 0-255 وتعيد نفس شي

كيف اخليه من 0-255 لين 255-0 يعني العكس

Link to comment
local rectAlpha = 0;
local state = "up";

function test()
  if state == "up" then rectAlpha=rectAlpha+1 end
  if state == "down" then rectAlpha=rectAlpha-1 end
  if rectAlpha == 255 then state = "down" elseif rectAlpha == 0 then state = "up" end
  dxDrawRectangle(416, 174, 498, 373, tocolor(0, 0, 0, rectAlpha), false)
end
addEventHandler("onClientRender", root, test)

 

  • Thanks 1
Link to comment
5 minutes ago, NX_CI said:

local rectAlpha = 0;
local state = "up";

function test()
  if state == "up" then rectAlpha=rectAlpha+1 end
  if state == "down" then rectAlpha=rectAlpha-1 end
  if rectAlpha == 255 then state = "down" elseif rectAlpha == 0 then state = "up" end
  dxDrawRectangle(416, 174, 498, 373, tocolor(0, 0, 0, rectAlpha), false)
end
addEventHandler("onClientRender", root, test)

 

مشككككككككور ي حبيب ❤️

 

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