Jump to content

downloadFile


xTravax

Recommended Posts

hello

i wanted to ask if this thing would be possible

i got much mods in my server so im wondering about this

-- meta 
"modname.dff" download="false" /> 
"modname.txd" download="false" /> 
  

--script 
function downloadTimer() 
setTimer(downloadFiles,30000,1) 
end 
addEventHandler("onClientResourceStart",root,downloadTimer) 
  
function downloadFiles() 
    downloadFile ( "modname.dff" ) 
    downloadFile ( "modname.txd" ) 
end 
  

this script has some flaws like

whenever resource would start for someone,it would restart download and overwrite files but it can be fixed with fileExists function

i was just wondering would this kind of thing work?

Link to comment

as far as i know it could be mta related bug as you said or it could be that the files are damaged,but my files are 100% sure not damaged so it must be a mta bug.

would be nice if someone could report this bug as i can't make account on bugs.mtasa.com site

Link to comment

You could try to navigate to: "C:\Program Files (x86)\MTA San Andreas 1.4\mods\deathmatch\resources" and see if your resource is in there. Disconnect from your local server and remove your resource from above directory, refresh your server resources and connect again. CRC mismatch are, just like the name says mismatched resources. Not fully sure about this but it's a good idea to try it out, if it works it sure is a good idea which let your players enjoy the game while downloading too.

Link to comment

i can't find the resource folder in both 1.3 and 1.4 folder

F8 console outputs this

Download error: HTTP server file mismatch (resourcename) font.ttf

Download error: HTTP server file mismatch (resourcename) image.jpg

Download error: HTTP server file mismatch (resourcename) test.mp3

Download error: HTTP server file mismatch (resourcename) test.png

and local server console:

[09:36:50] DIAGNOSTIC: *playername* #1002 HTTP server file mismatch (resourcename) font.ttf

i checked in fetchRemote and it says 1002 is download aborted

however i still dont get it,why does this function have anything to do related with html?

could this error come because im using local server?

Link to comment

well then maybe my code or meta is wrong

function downloadTimer() 
setTimer(downloadFiles,30000,1) 
end 
addEventHandler("onClientResourceStart",root,downloadTimer) 
  
function downloadFiles() 
outputChatBox("downloading server files...") 
    downloadFile ( "test.png" ) 
    downloadFile ( "test.mp3" ) 
    downloadFile ( "image.jpg" ) 
    downloadFile ( "font.ttf" ) 
end 
  
function downloadFinish() 
outputChatBox("Download Finished!") 
addEventHandler("onClientFileDownloadComplete",root,downloadFinish) 


perhaps i need to have same order in meta as in script with downloading files?

btw here are test files i've used

https://www.mediafire.com/?wx6446kmkdpf651

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