igthomas Posted January 14, 2012 Share Posted January 14, 2012 Hi I'm new in the MTA Community but not very new in scripting so I know some basics. What I want is to import elegy1.txd, elegy2.txd,... And tuning parts like bumper, exhausts, etc Is that possible? Link to comment
myonlake Posted January 14, 2012 Share Posted January 14, 2012 It is. As you know, upgrades are -objects- (at least as far as I know?). You need to replace the objects. And if I was wrong, you should make a script that attaches upgrades to your car (objects) and they're replaced with you .txd's. Link to comment
codeluaeveryday Posted January 14, 2012 Share Posted January 14, 2012 [url=https://wiki.multitheftauto.com/wiki/Vehicle_Upgrades]https://wiki.multitheftauto.com/wiki/Vehicle_Upgrades[/url] [url=https://wiki.multitheftauto.com/wiki/EngineImportTXD]https://wiki.multitheftauto.com/wiki/EngineImportTXD[/url] Make a script to replace them! Link to comment
igthomas Posted January 15, 2012 Author Share Posted January 15, 2012 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
Xeno Posted January 15, 2012 Share Posted January 15, 2012 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
igthomas Posted January 17, 2012 Author Share Posted January 17, 2012 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
Xeno Posted January 17, 2012 Share Posted January 17, 2012 That may mean the files are bugged or dont work. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now