Jump to content

[Help]Import elegy1.txd and tuning parts


igthomas

Recommended Posts

Strange I did everything like in the wiki and still not working :/

outputChatBox ( "> replacing the uranus vehicle" ) 
  
txd = engineLoadTXD ( "data/uranus.txd" ) 
engineImportTXD ( txd, 558 ) 
dff = engineLoadDFF ( "data/uranus.dff", 558 ) 
engineReplaceModel ( dff, 558 ) 
  
outputChatBox ( "> replacing paintjob1" ) 
paintjob1 = engineLoadTXD ( "data/uranus1.txd" ) 
engineImportTXD ( paintjob1, 558 ) 
  
outputChatBox ( "> replacing paintjob2" ) 
paintjob2 = engineLoadTXD ( "data/uranus2.txd" ) 
engineImportTXD ( paintjob2, 558 ) 
  
outputChatBox ( "> replacing paintjob3" ) 
paintjob3 = engineLoadTXD ( "data/uranus3.txd" ) 
engineImportTXD ( paintjob3, 558 ) 
  
outputChatBox ( "> replacing exh_a_u" ) 
exh_a_u = engineLoadDFF ( "data/exh_a_u.dff" ) 
engineImportDFF ( exh_a_u, 1089 ) 

Link to comment

You should read the scripting tutorial before even continuing! Well anyway, here:

  
function cars() 
outputChatBox ( "> replacing the uranus vehicle" ) 
  
txd = engineLoadTXD ( "data/uranus.txd" ) 
engineImportTXD ( txd, 558 ) 
dff = engineLoadDFF ( "data/uranus.dff", 558 ) 
engineReplaceModel ( dff, 558 ) 
  
outputChatBox ( "> replacing paintjob1" ) 
paintjob1 = engineLoadTXD ( "data/uranus1.txd" ) 
engineImportTXD ( paintjob1, 558 ) 
  
outputChatBox ( "> replacing paintjob2" ) 
paintjob2 = engineLoadTXD ( "data/uranus2.txd" ) 
engineImportTXD ( paintjob2, 558 ) 
  
outputChatBox ( "> replacing paintjob3" ) 
paintjob3 = engineLoadTXD ( "data/uranus3.txd" ) 
engineImportTXD ( paintjob3, 558 ) 
  
outputChatBox ( "> replacing exh_a_u" ) 
exh_a_u = engineLoadDFF ( "data/exh_a_u.dff" ) 
engineImportDFF ( exh_a_u, 1089 ) 
end 
addCommandHandler("replacecars", cars) 

Type /replacecars to replace the skins.... And also you need to add the .txd's to your meta.

Link to comment

ok my brain is getting hot now :@

Well here's how I did my structure:

Resources

-Parts

----data

------elegy1.txd

------elegy2.txd

------elegy3.txd

------exh_a_l.dff

----script.lua

----meta.xml

script.lua:

function replaceModel() 
outputChatBox ( "> replacing the elegy vehicle" ) 
  
outputChatBox ( "> replacing paintjob1" ) 
paintjob1 = engineLoadTXD ( "data/elegy1.txd" ) 
engineImportTXD ( paintjob1, 562 ) 
  
outputChatBox ( "> replacing paintjob2" ) 
paintjob2 = engineLoadTXD ( "data/elegy2.txd" ) 
engineImportTXD ( paintjob2, 562 ) 
  
outputChatBox ( "> replacing paintjob3" ) 
paintjob3 = engineLoadTXD ( "data/elegy3.txd" ) 
engineImportTXD ( paintjob3, 562 ) 
  
outputChatBox ( "> replacing exh_a_l" ) 
exh_a_l = engineLoadDFF ( "data/exh_a_l.dff" ) 
engineImportDFF ( exh_a_u, 1034 ) 
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) 
addCommandHandler("replacecars", replaceModel) 

meta.xml:

    type="script" description="Car parts" author="Thomas" version="1.0.0" name="parts" /> 
    

When I start the resource I do /replacecars then I show me that it has replaced the car parts and it even rejects me from my car when I'm in and when I tune it. It doesn't show me the paintjobs and the exhaust is like from the original elegy :/

Xeno@ Thanks man, I've read the entire scripting guide even from other sites and other tutorials and all functions and events and it didn't help me with this problem :(

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