iiv03 Posted August 26, 2019 Posted August 26, 2019 (edited) سلأم عليكم معي مشكله ب كود هنا لما اسوي الريكتآنجل تتغير آرقام 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 August 26, 2019 by xFabel
#\_oskar_/# Posted August 26, 2019 Posted August 26, 2019 math.min((getTickCount()-tick)/2000,tick ) -- عدد مفتوح or math.min((getTickCount()-tick)/2000,10 ) -- العدد راح يكون 10 مرات ---- اذا في شئ ثاني تفضل قوله
iiv03 Posted August 26, 2019 Author Posted August 26, 2019 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 يعني العكس
iiv03 Posted August 26, 2019 Author Posted August 26, 2019 8 minutes ago, #\_oskar_/# said: مافهمت آول شي يعني تفتح تسوي حركه مثل كذا بعدين تنغلق وحده تسوي حركه كمان فهمت ول لسآ؟
nxFairlywell Posted August 26, 2019 Posted August 26, 2019 2 hours ago, xFabel said: آول شي يعني تفتح تسوي حركه مثل كذا بعدين تنغلق وحده تسوي حركه كمان فهمت ول لسآ؟ يعني أول مايوصل 255 يرجع يعد عكس لين 0 ؟
iiv03 Posted August 26, 2019 Author Posted August 26, 2019 40 minutes ago, NX_CI said: يعني أول مايوصل 255 يرجع يعد عكس لين 0 ؟ كفو عليك كذا قصدي ومايوقف
nxFairlywell Posted August 26, 2019 Posted August 26, 2019 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) 1
iiv03 Posted August 26, 2019 Author Posted August 26, 2019 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) مشككككككككور ي حبيب
N3xT Posted August 27, 2019 Posted August 27, 2019 function test() local alpha = math.sin ( getTickCount () / 200 ) dxDrawRectangle ( 416, 174, 498, 373, tocolor(0, 0, 0, 255*alpha), false ) end addEventHandler("onClientRender", root, test) 1 1
Master_MTA Posted August 29, 2019 Posted August 29, 2019 On 27/08/2019 at 11:07, N3xT said: function test() local alpha = math.sin ( getTickCount () / 200 ) dxDrawRectangle ( 416, 174, 498, 373, tocolor(0, 0, 0, 255*alpha), false ) end addEventHandler("onClientRender", root, test) اخص اللي يفهم رياضيات
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