joaosilva099 Posted September 10, 2014 Share Posted September 10, 2014 (edited) Hi all... I Have this SIMPLE script to download and replace vehicle mods: function replaceModel() txd = engineLoadTXD("429.txd", 429 ) engineImportTXD(txd, 429) dff = engineLoadDFF("429.dff", 429 ) engineReplaceModel(dff, 429) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) But the problem is that with more mods i add it is raising the ammount of MB that the player has to download. That script downloads mods and after that the player can join the game I want is a script that only downloads the mods when the player logs in so that he can play same time the mods are downloading... Hope u can help me Thanks! Edited September 15, 2014 by Guest Link to comment
bandi94 Posted September 10, 2014 Share Posted September 10, 2014 Well there is a reasone of why the player can't play while downloading ( actualy there are more ... ). But one of them is : the download will take the bandwidth, if the player has a bad internet connection then he will have a very nasty lag. Anyway it is possible check this out : https://community.multitheftauto.com/in ... ls&id=3379 Link to comment
crismar Posted September 10, 2014 Share Posted September 10, 2014 You can add mods in the Meta with attribute: download = "false" And downloadFile after the player logs in for example. Link to comment
joaosilva099 Posted September 10, 2014 Author Share Posted September 10, 2014 Can do some sample to me? I think that to but dont worked Link to comment
xXMADEXx Posted September 11, 2014 Share Posted September 11, 2014 You can try to use this script, but I didn't test it local files = { ["files/mydff.dff"] = { id=400, type="dff" }, ["files/mytxd.txd"] = { id=400, type="txd" }, } for i, v in pairs ( files ) do downloadFile ( i ) end addEventHandler ( "onClientFileDownloadComplete", root, function ( _, success ) if ( success ) then local allDone = true for i, v in pairs ( files ) do if ( not fileExists ( i ) ) then allDone = false break end end if ( allDone ) then for i, v in pairs( files ) do local v.type = tostring ( v.type ):lower ( ) if ( v.type == "dff" ) then local dff = engineLoadDFF ( i, 0 ) if ( not dff or not engineReplaceModel ( dff, v.id ) ) then outputDebugString ( "Failed to replace ".. tostring ( i ).. " (Loading file as .dff | Tryed to replace model "..tostring(v.id)..")" ) end elseif ( v.type == 'txd' ) then local txd = engineLoadTXD ( i ) if ( not txd or not engineImportTXD ( txd, v.id ) ) then outputDebugString ( "Failed to replace ".. tostring ( i ).. " (Loading file as .txd | Tryed to replace model "..tostring(v.id)..")" ) end else outputDebugString ( "Failed to replace ".. tostring ( i ).. " (Unknown type -> Allowed: txd, dff)" ) end end end end end ) Link to comment
Et-win Posted September 11, 2014 Share Posted September 11, 2014 Take a look here: https://forum.multitheftauto.com/viewtopic.php?t=78826 Second reply, I gave this person a complete download script. You can edit to how you want it though. Link to comment
joaosilva099 Posted September 11, 2014 Author Share Posted September 11, 2014 et-win i cant find your script... Link to comment
Et-win Posted September 13, 2014 Share Posted September 13, 2014 https://forum.multitheftauto.com/viewtopic.php?f ... 6&start=45 Second post. Link to comment
xeon17 Posted September 13, 2014 Share Posted September 13, 2014 Nice script e-win , thanks too Link to comment
Et-win Posted September 13, 2014 Share Posted September 13, 2014 Maybe I will make a system of it, Idk. Link to comment
SkatCh Posted September 13, 2014 Share Posted September 13, 2014 Maybe I will make a system of it, Idk. nice bro can u please explaine to me how ? , with full script ofc if u have time Link to comment
Et-win Posted September 13, 2014 Share Posted September 13, 2014 Maybe I will make a system of it, Idk. nice bro can u please explaine to me how ? , with full script ofc if u have time Just use the one from the link? Lol. Link to comment
SkatCh Posted September 13, 2014 Share Posted September 13, 2014 sorry bro i don't know where is the correct one can u post it here i'm sorry if i waste ur time. Link to comment
Et-win Posted September 13, 2014 Share Posted September 13, 2014 https://forum.multitheftauto.com/viewtopic.php?f ... 6&start=45 Second post. Explanation how to use it is somewhere in that topic too. Second page I think. 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