Jump to content

[help] model don't oad


xxMANxx

Recommended Posts

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
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
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
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
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/EngineImportTXD
https://wiki.multitheftauto.com/wiki/EngineLoadTXD
https://wiki.multitheftauto.com/wiki/EngineLoadDFF
https://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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...