Master_MTA Posted March 17, 2017 Share Posted March 17, 2017 السلام عليكم ورحمة الله وبركاته شباب استفسار بسيط وش الخطا هنا لخبيري الدي اكس dxDrawImage((screenW - 112) / 2, (screenH - 84) / 3, 112, 84, 'http://image.prntscr.com/image/7da34725406b4354b8a98c6117863860.png', 0, 0, 0, tocolor(255, 255, 255, 255), true) Link to comment
#Soking Posted March 17, 2017 Share Posted March 17, 2017 راجع الارقمنتات و تاكد من المسار Link to comment
Master_MTA Posted March 17, 2017 Author Share Posted March 17, 2017 1 minute ago, #Soking said: راجع الارقمنتات و تاكد من المسار راجعت +هذا رابط شغال مجربه Link to comment
Master_MTA Posted March 17, 2017 Author Share Posted March 17, 2017 Just now, #Soking said: المفروض مسار مو رابط في بعض الاحيان الرابط يعمل شف image: Either a material element or a filepath of the image which is going to be drawn. (.dds images are also supported). Image files should ideally have dimensions that are a power of two, to prevent possible blurring. Link to comment
#Soking Posted March 17, 2017 Share Posted March 17, 2017 FilePath يستدعي صوره من ملف ماله صلاح ب الانترنت Link to comment
Master_MTA Posted March 17, 2017 Author Share Posted March 17, 2017 material اقدر اسوي شادر ؟ برابط؟ Link to comment
#Soking Posted March 17, 2017 Share Posted March 17, 2017 سوي عبر ذا الفنكشن https://wiki.multitheftauto.com/wiki/FetchRemote غير كذا فيه امثله جوا ع نفس طلبك Link to comment
Master_MTA Posted March 17, 2017 Author Share Posted March 17, 2017 (edited) 25 minutes ago, #Soking said: سوي عبر ذا الفنكشن https://wiki.multitheftauto.com/wiki/FetchRemote غير كذا فيه امثله جوا ع نفس طلبك سويت addEvent('changthephoto',true) addEventHandler('changthephoto',root,function(photo) if photo then fetchRemote ( photo , function ( responseData, errno ) if errno == 0 then local file = fileCreate ( "myImage.png" ) if ( file ) then fileWrite ( file , responseData ) fileClose ( file ) png= file end end end) else png='photo.png' end end) addEventHandler("onClientRender", root, function() if getElementData(me,'photo')==true then dxDrawImage((screenW - 112) / 2, (screenH - 84) / 3, 112, 84, png, 0, 0, 0, tocolor(255, 255, 255, 255), true) end end ) شف لكن مشكلته ياخذ وقت الى ان تتغير الصوره كنت اول مسويها ستاتيك اميج لكن عشان التحميل حق الصوره بطيء فخليتها دي اكس لاني سمعت انها تقبل روابط عشان تجي بسرعه 25 minutes ago, #Soking said: سوي عبر ذا الفنكشن https://wiki.multitheftauto.com/wiki/FetchRemote غير كذا فيه امثله جوا ع نفس طلبك حلو جاني حل حلو بس هل في فنكشن يقدر يضيف ملف للميتا؟ @3NAD @!#NssoR_) @Abdul KariM @#Soking @MR.S3D Edited March 17, 2017 by Master_MTA Link to comment
N3xT Posted March 17, 2017 Share Posted March 17, 2017 Server: imageName = "forum.png" imageURL = "www.mtasa.com/forum.png" function startImageDownload( playerToReceive ) fetchRemote ( imageURL, myCallback, "", false, playerToReceive ) end function myCallback( responseData, errno, playerToReceive ) if errno == 0 then triggerClientEvent( playerToReceive, "onClientGotImage", resourceRoot, responseData ) local file = fileCreate ( imageName ) if ( file ) then fileWrite ( file , responseData ) fileClose ( file ) end end end Client: addEvent( "onClientGotImage", true ) addEventHandler( "onClientGotImage", resourceRoot, function( pixels ) if myTexture then destroyElement( myTexture ) end myTexture = dxCreateTexture( pixels ) end ) addEventHandler("onClientRender", root, function() if myTexture then local w,h = dxGetMaterialSize( myTexture ) dxDrawImage( 200, 100, w, h, myTexture ) end end ) Link to comment
Master_MTA Posted March 17, 2017 Author Share Posted March 17, 2017 6 minutes ago, N3xT said: Server: imageName = "forum.png" imageURL = "www.mtasa.com/forum.png" function startImageDownload( playerToReceive ) fetchRemote ( imageURL, myCallback, "", false, playerToReceive ) end function myCallback( responseData, errno, playerToReceive ) if errno == 0 then triggerClientEvent( playerToReceive, "onClientGotImage", resourceRoot, responseData ) local file = fileCreate ( imageName ) if ( file ) then fileWrite ( file , responseData ) fileClose ( file ) end end end Client: addEvent( "onClientGotImage", true ) addEventHandler( "onClientGotImage", resourceRoot, function( pixels ) if myTexture then destroyElement( myTexture ) end myTexture = dxCreateTexture( pixels ) end ) addEventHandler("onClientRender", root, function() if myTexture then local w,h = dxGetMaterialSize( myTexture ) dxDrawImage( 200, 100, w, h, myTexture ) end end ) حبيب قلبي مشكور على الرد ولكن شكلك ما فهمت قصدي شف انا ابي طريقة مباشره بدون تحميل بمجرد تسجيل اللاعب تتخزن الصوره على السيرفر وتنظاف للميتا فهمت علي؟ Link to comment
N3xT Posted March 17, 2017 Share Posted March 17, 2017 ليه ما تحفظ الصورة من النت وتركبها بنفسك بالمود Link to comment
Master_MTA Posted March 17, 2017 Author Share Posted March 17, 2017 4 hours ago, N3xT said: ليه ما تحفظ الصورة من النت وتركبها بنفسك بالمود لاني جالس اسوي مود فكرته مبتكره شوي بتشوفوه قريب هذي اخر خطوه +_+ #Edit: ------------------------يعطيكم العافيه جميعا يغلق 1 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