Jump to content

Replace model and texture


MatXpl

Recommended Posts

Posted

here is it

.lua:

function replaceModel() 
 txd = engineLoadTXD("[color=#FF0000]carname.txd[/color]", 560 )
engineImportTXD(txd, 560)
 dff = engineLoadDFF("[color=#FF0000]carname.dff[/color]", 560 )
engineReplaceModel(dff, 560)
end
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel)
 
addCommandHandler ( "reloadcar", replaceModel )

meta.xml

<meta>
<info author="*sTx*" name="Race" version="1.0.0" type="script"/>
<script src="[color=#FF0000]CAR.lua[/color]" type="client"/>
<file src="[color=#FF0000]carname.txd[/color]" type="client"/>
<file src="[color=#FF0000]carname.dff[/color]" type="client"/>
</meta>

all, what i drawed in a red you must change to yours.

in archive (.zip) you must place .lua meta.xml and .txd\.dff files. That's all. =)

Posted

for peds you can only replace txd

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

  • 6 months later...
  • 4 months later...
Posted

script.lua=

function replaceModel() 
txd = engineLoadTXD("infernus.txd", 411 ) 
engineImportTXD(txd, 411) 
dff = engineLoadDFF("infernus.dff", 411 ) 
engineReplaceModel(dff, 411) 
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) 
addCommandHandler ( "reloadcar", replaceModel ) 

meta.xml=

<meta> 
<info author="[D.A]gnl.killer" name="Infernus" version="1.0.5" type="script"/> 
<script src="script.lua" type="client"/> 
<file src="infernus.txd" type="client"/> 
<file src="infernus.dff" type="client"/> 
</meta> 
  

560x95_FFFFFF_FF9900_000000_000000.png

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