greenops011 Posted Friday at 17:26 Share Posted Friday at 17:26 (edited) Does anyone know how I would replace a vehicle server side so that rather than use the default vehicle model when the vehicle spawns it will use the custom one I chose? This is not an addon vehicle, but a replacement Edited Friday at 17:27 by greenops011 Link to comment
O-Dog Posted Saturday at 00:30 Share Posted Saturday at 00:30 I have an already pre-made script that does the job well done, however its client side but not big of a change. here's how you can apply it; 1) Go to your MTA SA Directory file then server>mods>deathmatch>resources then create the folder that will contain your files (don't use symbols and space). 2) Inside that folder you created, you will need to have the .dff and .txd files of the car model you'd like to use, as well as the meta.xml and the client.lua files, should look like the following. 3)Open the client.lua and write this: function replaceModel() txd = engineLoadTXD("infernus.txd", 411 ) engineImportTXD(txd, 411) dff = engineLoadDFF("infernus.dff", 411 ) engineReplaceModel(dff, 411) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) replace the infernus with the model you want to change (i.e admiral,cheetah...) as well as the ID of the car which in my case was 411 (you can find the id you are looking for here. 4)Open the meta.xml and write this: <meta> <info name="skins-by-basel" version="1.4" type="misc"/> <script src="client.lua" type="client" /> <file src="infernus.txd" /> <file src="infernus.dff" /> </meta> 5)Enter your server and load the resource, enjoy This also work for ped skins as well, if you did find any issues, contact me on discord mehdi4664 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