xxMANxx Posted July 26, 2019 Share Posted July 26, 2019 I had some model of weapon. Once in the files I replaced with another one, the past is loaded anyway. I tried to clean the cache, but it does not help. Link to comment
xxMANxx Posted July 27, 2019 Author Share Posted July 27, 2019 10 hours ago, HassoN said: Show us your code. meta.xml <meta> <script src="replace_models_c.Lua" type="client"/> <file src="models/m4.dff" type="client"/> <file src="models/m4.txd" type="client"/> </meta> replace_models_c.Lua (client side) local id = 356 local txd = engineLoadTXD('m4.txd', id) engineImportTXD(txd, id) local dff = engineLoadDFF('m4.dff', id) engineReplaceModel(dff, id) The problem is that the G36S model was first in the files, then when I changed the model to M4A1, the G36C is loaded, although it is not in the files. Link to comment
HassoN Posted July 27, 2019 Share Posted July 27, 2019 You forgot to add the folder's name to your code. local id = 356 local txd = engineLoadTXD('models/m4.txd', id) engineImportTXD(txd, id) local dff = engineLoadDFF('models/m4.dff', id) engineReplaceModel(dff, id) Link to comment
xxMANxx Posted July 27, 2019 Author Share Posted July 27, 2019 1 hour ago, HassoN said: You forgot to add the folder's name to your code. local id = 356 local txd = engineLoadTXD('models/m4.txd', id) engineImportTXD(txd, id) local dff = engineLoadDFF('models/m4.dff', id) engineReplaceModel(dff, id) this is not a problem I think that the fact is that the model is loaded from the cache, how to let the server understand that the model has changed and needs to be loaded again? Link to comment
HassoN Posted July 27, 2019 Share Posted July 27, 2019 7 minutes ago, xxMANxx said: this is not a problem I think that the fact is that the model is loaded from the cache, how to let the server understand that the model has changed and needs to be loaded again? It changes automatically. If the txd/dff file on your server doesn't match client's txd/dff then it will change. Link to comment
xxMANxx Posted July 27, 2019 Author Share Posted July 27, 2019 10 minutes ago, HassoN said: It changes automatically. If the txd/dff file on your server doesn't match client's txd/dff then it will change. i changed the folder name now and this doing properly but that workaround Link to comment
Dimos7 Posted July 27, 2019 Share Posted July 27, 2019 local id = 356 local txd = engineLoadTXD('models/m4.txd') engineImportTXD(txd, id) local dff = engineLoadDFF('models/m4.dff') engineReplaceModel(dff, id) 2 argument on load txd is bollen not the id of weapon and in dff is only 1 argument Link to comment
xxMANxx Posted July 27, 2019 Author Share Posted July 27, 2019 5 minutes ago, Dimos7 said: local id = 356 local txd = engineLoadTXD('models/m4.txd') engineImportTXD(txd, id) local dff = engineLoadDFF('models/m4.dff') engineReplaceModel(dff, id) 2 argument on load txd is bollen not the id of weapon and in dff is only 1 argument https://wiki.multitheftauto.com/wiki/EngineImportTXDhttps://wiki.multitheftauto.com/wiki/EngineLoadTXDhttps://wiki.multitheftauto.com/wiki/EngineLoadDFFhttps://wiki.multitheftauto.com/wiki/EngineReplaceModel Example 1: This example loads a combination of a custom DFF and TXD file to replace the Euros vehicle in-game. The collisions are embedded inside the DFF file. outputChatBox ( "> replacing the euros vehicle" ) txd = engineLoadTXD ( "data/euros.txd" ) engineImportTXD ( txd, 587 ) dff = engineLoadDFF ( "data/euros.dff" ) engineReplaceModel ( dff, 587 ) 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