Jump to content

Replacing a vehicle (server side)


greenops011

Recommended Posts

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.

dca8UEj.png
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 :D
 
 
 
 
This also work for ped skins as well, if you did find any issues, contact me on discord mehdi4664
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...