jingzhi Posted February 28, 2015 Share 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? Link to comment
xTravax Posted February 28, 2015 Share Posted February 28, 2015 um try replacing "rhino.txd" download="false"> "rhino.dff" download="false"> with "rhino.txd" download="false" /> "rhino.dff" download="false" /> Link to comment
jingzhi Posted February 28, 2015 Author Share 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 Link to comment
-.Paradox.- Posted March 3, 2015 Share Posted March 3, 2015 How did you know the download failed? The models wont replace itselves Link to comment
xXMADEXx Posted March 4, 2015 Share Posted March 4, 2015 What file(s) does it say doesn't exist? Link to comment
jingzhi Posted March 4, 2015 Author Share 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 Link to comment
Moderators IIYAMA Posted March 4, 2015 Moderators Share Posted March 4, 2015 Show updated code. Link to comment
jingzhi Posted March 4, 2015 Author Share 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 Link to comment
jingzhi Posted March 5, 2015 Author Share 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 Link to comment
Moderators IIYAMA Posted March 5, 2015 Moderators Share 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! Link to comment
jingzhi Posted March 5, 2015 Author Share 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 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