masgoku Posted January 31, 2015 Share Posted January 31, 2015 I have made a script for replacing vehicle models in my server, it work fine for the first four vehicles and now it won't work at all but script is the same all the way through out. This is the script below and before you ask I do have everything in the meta for the models. function ReplaceVehicle ( ) txd = engineLoadTXD ( "monster3.txd" ) engineImportTXD ( txd, 557 ) dff = engineLoadDFF ( "monster3.dff", 0 ) engineReplaceModel ( dff, 557 ) end addEvent ( "replaceVeh", true ) addEventHandler ( "replaceVeh", getRootElement(), ReplaceVehicle ) function ReplaceVehicle ( ) txd = engineLoadTXD ( "infernus.txd" ) engineImportTXD ( txd, 411 ) dff = engineLoadDFF ( "infernus.dff", 0 ) engineReplaceModel ( dff, 411 ) end addEvent ( "replaceVeh", true ) addEventHandler ( "replaceVeh", getRootElement(), ReplaceVehicle ) function ReplaceVehicle ( ) txd = engineLoadTXD ( "cheetah.txd" ) engineImportTXD ( txd, 415 ) dff = engineLoadDFF ( "cheetah.dff", 0 ) engineReplaceModel ( dff, 415 ) end addEvent ( "replaceVeh", true ) addEventHandler ( "replaceVeh", getRootElement(), ReplaceVehicle ) function ReplaceVehicle ( ) txd = engineLoadTXD ( "hustler.txd" ) engineImportTXD ( txd, 545 ) dff = engineLoadDFF ( "hustler.dff", 0 ) engineReplaceModel ( dff, 545 ) end addEvent ( "replaceVeh", true ) addEventHandler ( "replaceVeh", getRootElement(), ReplaceVehicle ) function ReplaceVehicle ( ) txd = engineLoadTXD ( "comet.txd" ) engineImportTXD ( txd, 480 ) dff = engineLoadDFF ( "comet.dff", 0 ) engineReplaceModel ( dff, 480 ) end addEvent ( "replaceVeh", true ) addEventHandler ( "replaceVeh", getRootElement(), ReplaceVehicle ) Link to comment
ALw7sH Posted January 31, 2015 Share Posted January 31, 2015 local vehicls = { -- [carID] = "car file name", [557] = "monster3", [411] = "infernus", [415] = "cheetah", [545] = "hustler", [480] = "comet", } function ReplaceVehicle ( ) for id,name in pairs(vehicls) do txd = engineLoadTXD ( name..".txd" ) engineImportTXD ( txd, id ) dff = engineLoadDFF ( name..".dff", 0 ) engineReplaceModel ( dff, id ) end end addEvent ( "replaceVeh", true ) addEventHandler ( "replaceVeh", getRootElement(), ReplaceVehicle ) Link to comment
Dealman Posted January 31, 2015 Share Posted January 31, 2015 If it truly doesn't work, I guess it could be some memory issue. Avoid using a lot of ridiculously over-sized models and textures. However, that said, there is something wrong with model replacing for sure. I've modded in a few vehicles into MTA myself, and randomly(albeit rarely) they will sort of lose their suspension setting or something. They just slide along on the ground. Similar to when you give hydraulics to the monster truck - except the wheels look fine. Absolutely no clue what causes it. Link to comment
masgoku Posted February 1, 2015 Author Share Posted February 1, 2015 local vehicls = { -- [carID] = "car file name", [557] = "monster3", [411] = "infernus", [415] = "cheetah", [545] = "hustler", [480] = "comet", } function ReplaceVehicle ( ) for id,name in pairs(vehicls) do txd = engineLoadTXD ( name..".txd" ) engineImportTXD ( txd, id ) dff = engineLoadDFF ( name..".dff", 0 ) engineReplaceModel ( dff, id ) end end addEvent ( "replaceVeh", true ) addEventHandler ( "replaceVeh", getRootElement(), ReplaceVehicle ) Hey I tried this the same issue is still happening not sure why, but thanks I will use this method in the future much more clean looking. Link to comment
masgoku Posted February 1, 2015 Author Share Posted February 1, 2015 If it truly doesn't work, I guess it could be some memory issue. Avoid using a lot of ridiculously over-sized models and textures.However, that said, there is something wrong with model replacing for sure. I've modded in a few vehicles into MTA myself, and randomly(albeit rarely) they will sort of lose their suspension setting or something. They just slide along on the ground. Similar to when you give hydraulics to the monster truck - except the wheels look fine. Absolutely no clue what causes it. I tried ALw7sh's method still same issue think it might just be a weird issue with MTA honestly. Link to comment
Dealman Posted February 1, 2015 Share Posted February 1, 2015 Would be helpful if you could link us to the same models you are using so we could test this on our end and maybe find the cause. Link to comment
masgoku Posted February 24, 2015 Author Share Posted February 24, 2015 (edited) Hey, here are the vehicle models in a zip for you guys to download and work with. Vehicles.zip I uploaded the file to dropbox for more convenience. So enjoy and maybe we can resolve the issue I am having. Edited February 25, 2015 by Guest Link to comment
Callum Posted February 24, 2015 Share Posted February 24, 2015 I uploaded on 4Shared, so you can make an account or use Facebook and various other things to download the file. I'd recommend you look into setting up an account with Dropbox, or one of the many other cloud storage solutions available, so users don't have to surrender all of their personal information to download a file. Link to comment
masgoku Posted February 24, 2015 Author Share Posted February 24, 2015 Yeah good Idea I just changed the link and here it is https://www.dropbox.com/s/x115kys320mlav3/Vehicles.zip?dl=0 Now when you click the one above it is also dropbox. 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