Jump to content

مشكلة فى (downloadFile)


Recommended Posts

سلام عليكم ,

عندى مشكلة فى

downloadFile

انا بكتب اسم الملف اللى عايز احملة بس المشكلة ان الملف لما بيتحمل بيكون حجمة 0 

مع العلم ان ضايف الملف فى meta

و مخلى download="false"

Link to comment

استخدمتها من قبل و ما نفعت 

الملف بيتحمل و لكن لما اخش على اشوفة فى مكان التحميل فى \MTA San Andreas 1.5\mods\deathmatch\resources

القى الصورة مساحتها صفر كيلو بيت 

و جربت هذا الموضوع مع الكثير من انواع الملفات و فيها نفس المشكلة

Link to comment

function onThisResourceStart ( )
    downloadFile ( "images/background.jpg" )
end
addEventHandler ( "onClientResourceStart", resourceRoot, onThisResourceStart )

function onDownloadFinish ( file, success )
    if ( source == resourceRoot ) then                            
        if ( success ) then                                       
            if ( file == "images/background.jpg" ) then                        
                outputChatBox ( "test.jpg downloaded" )                
            end
        else                                                      
            if ( file == "images/background.jpg" ) then
                outputChatBox ( "test.jpg failed to download" )
            end
        end
    end
end
addEventHandler ( "onClientFileDownloadComplete", root, onDownloadFinish )

 

Link to comment
<meta>
 <min_mta_version client="1.5.4" server="1.5.4" />
	<script src="client.lua" type="client" cache="false"/>
	<file src="images/background.jpg" download="false"/>
</meta>

 

#Edit:

تمام انا حولت الصورة لى .png 

بس دلوقتى بيطلع فى الشات 

background.png failed to download

اية الحل 

Link to comment

انت الحين خفيت التحميل لازم ترجع تحمله 

وماراح يظهر في الشريط

addEventHandler ( "onClientResourceStart", root,
	function ()
			downloadFile ("background.png")
		end
)

 

Edited by #MR.NaiF
Link to comment

جربت الكود حقق و ما نفع لسا بردو بيظهر نفس الرسالة

background.png failed to download
 

هذا هوا الكود 


addEventHandler ( "onClientResourceStart", root,
	function ()
			downloadFile ("images/background.png")
		end
)

function onDownloadFinish ( file, success )
    if ( source == resourceRoot ) then                            
        if ( success ) then                                       
            if ( file == "images/background.png" ) then                        
                outputChatBox ( "background.png downloaded" )                
            end
        else                                                      
            if ( file == "images/background.png" ) then
                outputChatBox ( "background.png failed to download" )
            end
        end
    end
end
addEventHandler ( "onClientFileDownloadComplete", root, onDownloadFinish )

 

Link to comment
On ١٩‏/٦‏/٢٠١٧ at 00:51, darbka2002 said:

<meta>
 <min_mta_version client="1.5.4" server="1.5.4" />
	<script src="client.lua" type="client" cache="false"/>
	<file src="images/background.jpg" download="false"/>
</meta>

 

#Edit:

تمام انا حولت الصورة لى .png 

بس دلوقتى بيطلع فى الشات 

background.png failed to download

اية الحل 

متأكد انك مسوي ملف images ??

Link to comment
38 minutes ago, darbka2002 said:

نعم متئكد ان مسار الصورة images

متاكد انك حولت الصورة

من ملف الميتا


<meta>
 <min_mta_version client="1.5.4" server="1.5.4" />
	<script src="client.lua" type="client" cache="false"/>
	<file src="images/background.jpg" download="false"/>-------------- background.pngسوي 
</meta>

 

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