WzKhalifa Posted January 5, 2015 Share Posted January 5, 2015 Help Help I got a DownLoadFile in the community. However need to put a DxDrawImage on the bottom during download, and when I have the onClientDownloadComplete it replaces the TXD, if I log back .. no longer works .. does not replace again, I feel that we have put onClientResourceStart filePath = { { "400.txd", 400 }; { "400.dff", 400 }; -- { "Arquivo", ID }; }; modelID = { }; function checkTransfer ( ) if isTransferBoxActive ( ) == true then setTimer ( checkTransfer, 1000, 1 ); else for i, v in ipairs ( filePath ) do local file, ID = v [ 1 ], v [ 2 ]; if not modelID [ file ] then downloadFile ( file ); modelID [ file ] = ID; end end end end addEventHandler ( "onClientResourceStart", resourceRoot, checkTransfer ); addEventHandler("onClientDownloadComplete", getRootElement(), function ( file, success ) if success then local ID = modelID [ file ]; if ID then if string.find ( file, ".txd" ) then txd = engineLoadTXD ( file ); engineImportTXD ( txd, ID ); end if string.find ( file, ".dff" ) then dff = engineLoadDFF ( file, ID ); engineReplaceModel ( dff, ID ); end end end end ); Link to comment
TrapLord Studios™ Posted January 6, 2015 Share Posted January 6, 2015 When it's downloaded it doesn't save I presume you have to make a way so the file is saved to the specific vehicle I advice using Mysql. Link to comment
Castillo Posted January 6, 2015 Share Posted January 6, 2015 Why would he use MySQL for a client side vehicle downloader? Link to comment
WzKhalifa Posted January 6, 2015 Author Share Posted January 6, 2015 Remembering that he is saving the files ( 400.txd / 400.dff ), just is not replacing the vehicle model. Lines in the metafile: Link to comment
Castillo Posted January 6, 2015 Share Posted January 6, 2015 You put the wrong event name, is not "onClientDownloadComplete", it's "onClientFileDownloadComplete". https://wiki.multitheftauto.com/wiki/On ... adComplete Link to comment
WzKhalifa Posted January 6, 2015 Author Share Posted January 6, 2015 in the case was going to be like this? client finishes download + linking feature function onDownloadFinish ( file, success ) if success then local ID = modelID [ file ]; if ID then if string.find ( file, ".txd" ) then txd = engineLoadTXD ( file ); engineImportTXD ( txd, ID ); end if string.find ( file, ".dff" ) then dff = engineLoadDFF ( file, ID ); engineReplaceModel ( dff, ID ); end end end end addEventHandler ( "onClientFileDownloadComplete", getRootElement(), onDownloadFinish ) addEventHandler ( "onClientResourceStart", getRootElement(), onDownloadFinish ) Link to comment
TrapLord Studios™ Posted January 6, 2015 Share Posted January 6, 2015 Ohh, I thought he was using the downloadFile script to, download an Image then apply it as a texture my mistake. Link to comment
Castillo Posted January 6, 2015 Share Posted January 6, 2015 in the case was going to be like this? client finishes download + linking feature function onDownloadFinish ( file, success ) if success then local ID = modelID [ file ]; if ID then if string.find ( file, ".txd" ) then txd = engineLoadTXD ( file ); engineImportTXD ( txd, ID ); end if string.find ( file, ".dff" ) then dff = engineLoadDFF ( file, ID ); engineReplaceModel ( dff, ID ); end end end end addEventHandler ( "onClientFileDownloadComplete", getRootElement(), onDownloadFinish ) addEventHandler ( "onClientResourceStart", getRootElement(), onDownloadFinish ) No need "onClientResourceStart" for function onDownloadFinish. Link to comment
WzKhalifa Posted January 6, 2015 Author Share Posted January 6, 2015 So actually I wanted to ask script download files, and soon after he bring down, he replacing textures of vehicles just downloaded, and so the player to reconnect replace it again, and so the feature start also replace the textures help Link to comment
WzKhalifa Posted January 9, 2015 Author Share Posted January 9, 2015 This download function, is working just fine, however when the low player for the first time, he Substitutes vehicle, but when I log back in, it will not replace the texture, just wanted to ask for it to be replaced after downloading and when I log back in, and if possible put a dx stating that're on download 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