Jump to content

Replacing problem


Norhy

Recommended Posts

Hi, when i replace some weapons with other models, they don't replace. It always only replace the M4 model. Here's M4 script:

function replaceWeapon ( ) 
  
    txd = engineLoadTXD ( "weapons/m4.txd" ) 
    engineImportTXD ( txd, 356 ) 
    dff = engineLoadDFF ( "weapons/M4.dff", 356 ) 
    engineReplaceModel ( dff, 356 ) 
end 
addEventHandler ( "onClientResourceStart", resourceRoot, replaceWeapon ) 

And here's a Desert Eagle script:

function replaceWeapon ( ) 
  
    txd = engineLoadTXD ( "weapons/desert_eagle.txd" ) 
    engineImportTXD ( txd, 24 ) 
    dff = engineLoadDFF ( "weapons/desert_eagle.dff", 24 ) 
    engineReplaceModel ( dff, 24 ) 
end 
addEventHandler ( "onClientResourceStart", resourceRoot, replaceWeapon ) 

I make them once, so i make 1 lua file, save it, and again. They are all in a File together with the model replacements.

Link to comment
Hi, when i replace some weapons with other models, they don't replace. It always only replace the M4 model. Here's M4 script:
function replaceWeapon ( ) 
  
    txd = engineLoadTXD ( "weapons/m4.txd" ) 
    engineImportTXD ( txd, 356 ) 
    dff = engineLoadDFF ( "weapons/M4.dff", 356 ) 
    engineReplaceModel ( dff, 356 ) 
end 
addEventHandler ( "onClientResourceStart", resourceRoot, replaceWeapon ) 

And here's a Desert Eagle script:

function replaceWeapon ( ) 
  
    txd = engineLoadTXD ( "weapons/desert_eagle.txd" ) 
    engineImportTXD ( txd, 24 ) 
    dff = engineLoadDFF ( "weapons/desert_eagle.dff", 24 ) 
    engineReplaceModel ( dff, 24 ) 
end 
addEventHandler ( "onClientResourceStart", resourceRoot, replaceWeapon ) 

I make them once, so i make 1 lua file, save it, and again. They are all in a File together with the model replacements.

You need use model id, not weapon id.

You can see here https://wiki.multitheftauto.com/wiki/Weapons ( in column Model ID )

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...