#Major . Posted July 19, 2018 Share Posted July 19, 2018 السلام عليكم احد عنده مكتبة او فنكشنات بروقرس بار دي اكس ؟ شكرا Link to comment
SycroX Posted July 19, 2018 Share Posted July 19, 2018 (edited) شوف انا اليوم بطريقه ما فاضي شويه فسويت لك البروجرس بار ذا بس ما جربته صراحه و مكسل اجربو ف جربو انت و قولي اذا به اخطاء local progressbar = {} function dxCreatePrograssBar(id, x, y, w, h, progress) table.insert(progressbar, {id, x, y, w, h, 0, false}) end function dxProgressBarSetVisible(id, bool) if id then for index,value in ipairs(progressbar) do if value[1] == id then progressbar[index][7] = bool end end end end function dxProgressBarGetVisible(id) if id then for _,value in ipairs(progressbar) do if value[1] == id then return value[7] end end end end function dxProgressBarSetProgress(id, progress) if id and progress then for index,value in ipairs(progressbar) do if value[1] == id then progressbar[index][6] = progress end end end end function dxProgressBarGetProgress(id) if id then for _,value in ipairs(progressbar) do if value[1] == id then return value[6] end end end end function dxRemoveProgressBar(id) if id then for index,value in ipairs(progressbar) do if value[1] == id then progressbar[index] = nil end end end end addEventHandler("onClientRender", root, function() if #progressbar > 0 then for _,value in ipairs(progressbar) do if value[1] and value[2] and value[3] and value[4] and value[5] and value[6] then if value[7] then local x, y, w, h = value[2], value[3], value[4], value[5] dxDrawRectangle(x, y, w, h, tocolor(0, 0, 0, 150), false) -- background dxDrawRectangle(x, y, value[6]*(w/100), h, tocolor(0, 0, 0, 150), false) -- progress end end end end end ) Edited July 19, 2018 by #َxLysandeR Link to comment
Trefeor Posted July 19, 2018 Share Posted July 19, 2018 شوف هذا اخذته لك من موضوع اليوزفل فنكشن local dxProgressBar = { Data = {} } function dxCreateProgressBar (x,y,w,h,text,prog) local element = createElement('dxProgressBar') dxProgressBar.Data[element] = {x=x,y=y,w=w,h=h,text=text,prog=prog} return element end function dxProgressBarGetProgressBar ( element ) if ( getElementType ( element ) == 'dxProgressBar' ) then return dxProgressBar.Data[element].prog end return false end function dxProgressBarSetProgressBar ( element , prog_ ) if ( getElementType ( element ) == 'dxProgressBar' ) then dxProgressBar.Data[element].prog = prog_ end return false end function dxDrawProgressBar ( element1 ) if ( getElementType ( element1 ) == 'dxProgressBar' ) then local element = dxProgressBar.Data [ element1 ] local x,y,w,h,text,prog = element.x,element.y,element.w,element.h,element.text,element.prog if ( prog >= 100 ) then prog = 100 r,g,b,alpha = 0,255,0,255 r1,g1,b1 = 0,0,0 else prog = prog r,g,b,alpha = 255,0,0,255 r1,g1,b1 = 255,255,255 end dxDrawRectangle (x,y,w,h,tocolor(0,0,0,190),false) dxDrawRectangle (x,y,math.floor(prog)*w/100,h,tocolor(r,g,b,alpha),false) dxDrawText(text,x,y,x+w,y+h,tocolor(r1,g1,b1,255),1,'default-bold','center','center',false,false,false,true,true) end end ---- D = dxCreateProgressBar (66, 296, 346, 36,'Testing',0) addEventHandler("onClientRender", root, function( ) dxDrawProgressBar ( D ) dxProgressBarSetProgressBar ( D , dxProgressBarGetProgressBar ( D ) +1) end ) Source : @iMr.Omar Link to comment
#Major . Posted July 19, 2018 Author Share Posted July 19, 2018 ششكرا لكم @#َxLysandeR @Trefeor 1 1 Link to comment
^iiEcoo'x_) Posted July 19, 2018 Share Posted July 19, 2018 واحد ثاني اذا ودك https://wiki.multitheftauto.com/wiki/DxDrawProgressBar 1 Link to comment
N3xT Posted July 19, 2018 Share Posted July 19, 2018 للتوضيح فقط, ترا يمديك تسويه بنفسك وهو عبارة عن dxDrawRectangle وبعدين تتحكم بالعرض حقه Link to comment
#Major . Posted July 19, 2018 Author Share Posted July 19, 2018 3 hours ago, N3xT said: للتوضيح فقط, ترا يمديك تسويه بنفسك وهو عبارة عن dxDrawRectangle وبعدين تتحكم بالعرض حقه ادري بس قروشه وانا كنت مستعجل شكرا لك 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