jingzhi Posted February 28, 2015 Posted February 28, 2015 Scripts function download(resource) if resource == getThisResource() then outputChatBox("Download started") downloadFile("rhino.txd") downloadFile("rhino.dff") end end addEventHandler("onClientResourceStart",getRootElement(),download) meta "JingZhi" type="script" /> Hey guys I know I have asked a lot of questions these day, please don't get annoyed cause i'm a noobie, and noobies need help So i am trying to make this ingame downloader, but it always say the file doesnt exist, is there any problem in my scipts?
xTravax Posted February 28, 2015 Posted February 28, 2015 um try replacing "rhino.txd" download="false"> "rhino.dff" download="false"> with "rhino.txd" download="false" /> "rhino.dff" download="false" />
jingzhi Posted February 28, 2015 Author Posted February 28, 2015 um try replacing "rhino.txd" download="false"> "rhino.dff" download="false"> with "rhino.txd" download="false" /> "rhino.dff" download="false" /> I made it as you said now the "file doesnt exist" is gone but the download is still a failure
-.Paradox.- Posted March 3, 2015 Posted March 3, 2015 How did you know the download failed? The models wont replace itselves
jingzhi Posted March 4, 2015 Author Posted March 4, 2015 How did you know the download failed? The models wont replace itselves I used outputChatbox to see and it says it's failed
jingzhi Posted March 4, 2015 Author Posted March 4, 2015 Show updated code. function download(resource) if resource == getThisResource() then outputChatBox("Download started") downloadFile("rhino.txd") downloadFile("rhino.dff") end end addEventHandler("onClientResourceStart",getRootElement(),download) function replacemod(success) if success == true then local txd = engineLoadTXD ( "rhino.txd" ) local dff = engineLoadDFF ( "rhino.dff", 432 ) engineImportTXD ( txd, 432 ) engineReplaceModel ( dff, 432 ) else outputChatBox("Download was failed") end end addEventHandler("onClientFileDownloadComplete",getRootElement(),replacemod) This is the full code
jingzhi Posted March 5, 2015 Author Posted March 5, 2015 How did you know the download failed? The models wont replace itselves I have put the functions to load the mod
Moderators IIYAMA Posted March 5, 2015 Moderators Posted March 5, 2015 Your mistake: Parameters string fileName, bool success fileName: the file downloaded. success: whether successful or not. https://wiki.multitheftauto.com/wiki/On ... adComplete Success isn't the first parameter/variable!
jingzhi Posted March 5, 2015 Author Posted March 5, 2015 Your mistake:Parameters string fileName, bool success fileName: the file downloaded. success: whether successful or not. https://wiki.multitheftauto.com/wiki/On ... adComplete Success isn't the first parameter/variable! I see, thank you very much
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