Jump to content

[Help] How to replace the clothes


iPanda

Recommended Posts

I have a question for you - how to replace DFF model the clothes on the server?

I found a topic Vicky, who helps to solve this problem https://wiki.multitheftauto.com/wiki/Clothing_Component_IDs

But! When I replace my clothes on - Multiplayer MTA closes by itself. Crash.

I need your help. Help change the model, because I'm certainly doing something wrong. I look forward to your response!

txd = engineLoadTXD( "hockey.txd" ) 
engineImportTXD( txd, "hockey" ) 
dff = engineLoadDFF( "hockeymask.dff", "hockeymask" ) 
engineReplaceModel( dff, "hockeymask" ) 

Crash!

Type16index15.jpg

ps. Help to replace model a hockey mask to gas mask!

-

-

Link to comment

to replace models/textures, you need to specify the ID number, not it´s name.

the texture name of the hockey mask is "capgangover"

the model name of the hockey mask is "capovereye"

you can get texture ID, model ID with this function getTypeIndexFromClothes

->

  
textureID, modelID = getTypeIndexFromClothes ("capgangover", "capovereye"); 
txd = engineLoadTXD ("hockey.txd");  
engineImportTXD (txd, textureID);  
dff = engineLoadDFF ("hockeymask.dff", modelID); 
engineReplaceModel (dff, modelID);  
  

Link to comment
to replace models/textures, you need to specify the ID number, not it´s name.

the texture name of the hockey mask is "capgangover"

the model name of the hockey mask is "capovereye"

you can get texture ID, model ID with this function getTypeIndexFromClothes

->

  
textureID, modelID = getTypeIndexFromClothes ("capgangover", "capovereye"); 
txd = engineLoadTXD ("hockey.txd");  
engineImportTXD (txd, textureID);  
dff = engineLoadDFF ("hockeymask.dff", modelID); 
engineReplaceModel (dff, modelID);  
  

First: the texture and model hockey mask = "hockey" , "hockeymask"

Second: Your example still does not replace the model and texture! ... :(

Link to comment

oh, sorry...

  
textureID, modelID = getTypeIndexFromClothes ("hockey", "hockeymask"); 
txd = engineLoadTXD ("hockey.txd"); 
engineImportTXD (txd, textureID); 
dff = engineLoadDFF ("hockeymask.dff", modelID); 
engineReplaceModel (dff, modelID); 
  

Link to comment
oh, sorry...
  
textureID, modelID = getTypeIndexFromClothes ("hockey", "hockeymask"); 
txd = engineLoadTXD ("hockey.txd"); 
engineImportTXD (txd, textureID); 
dff = engineLoadDFF ("hockeymask.dff", modelID); 
engineReplaceModel (dff, modelID); 
  

Your example still does not replace the model and texture! ...

Link to comment

Ahh...if you want replace just the txd you could use

  
textures = {  
["hockey"] = 30376, 
} 
  
function replaceClothes()  
    for cloth, id in pairs(textures) do 
    local txd = engineLoadTXD(cloth..".txd") 
    engineImportTXD(txd, id) 
    end 
end 
addEventHandler("onClientResourceStart", resourceRoot, replaceClothes) 
  

you can just replace the txd, but dff i dont think you can replace..

  • Thanks 1
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...