Jump to content

Custom carmods.dat file


Recommended Posts

9 hours ago, ivan8065 said:

Hello, I would like to ask if it's possible to make some script which would load custom carmods.dat file after connecting on server. Thank you for reply.

The problem is solved as follows:
Open mtaserver.conf and look for the line <! - By default, the server will block the use of customized GTA: SA data files. ->
     <! - To allow specific client files, add one or more of the following: -> and below this line write this <client_file name = "data / carmods.dat" verify = "0" /> check for this file there will be no server side since the client side check is canceled. Please like me if you helped, thank you very much in advance.

Link to comment
9 hours ago, Tekken said:

Hi :)

Nope, don’t think so, however MTA supports a lot of handling modifications and custom tuning to vehicles if that’s what you looking for.

https://wiki.multitheftauto.com/wiki/AddVehicleUpgrade

Greetings.

Well the thing is, I would like to use for example front bumper from Jester on Sultan (just and example) and things like that and I think it would be possible with custom carmods.dat on server but I don't know if is possible to do it and I don't know if it will work with this function too.

Edited by ivan8065
Link to comment
  • MTA Anti-Cheat Team
1 hour ago, ivan8065 said:

Well the thing is, I would like to use for example front bumper from Jester on Sultan (just and example) and things like that

Mixing upgrade parts from different cars will obviously produce wrong results or crash the game, as they aren't made for eachother.

You should already be able to do what you have in mind (with replacing upgrade parts / loading custom upgrade parts made for that vehicle which you're applying them to). Often it's even neccesary, as GTA vehicle mods sites offer many models that come with multiple smaller DFF files, which are the upgrade parts designed for their mod, so you'll need to 'port' them to MTA by using a script that replaces it all.

You can better understand this stuff after inspecting this example resource that i uploaded: https://community.multitheftauto.com/index.php?p=resources&s=details&id=18483

Just look at the code and files. It's a Jester mod, that also loads various upgrade parts, such as rear and front bumper. It's a piece of cake, and you don't need to be messing about with anything like carmods.dat

Anyways, if you really want to "put Jester front bumper on a Sultan" (no matter how visually crippled that will look), in theory you would need to export the bumper part of Jester (e.g rbmp_c_j.dff, using Alci IMG tool) and load it onto the Jester as its own front bumper (ID 1169, fbmp_a_s.dff) simply by replacing the Sultan bumper model with the desired bumper upgrade part, in the same way as the above example resource does it.

If you want to understand the logic better: Each vehicle in GTA SA supports only its own upgrade parts (specific IDs, like for bumper variants) so you can decide the model used for those IDs and applying any custom model to it (like one modelled by yourself, so looking as entirely different bumper). You cannot apply the upgrade ID from another vehicle, to a vehicle for which that ID is not (take a look at
Wiki: Vehicle Upgrade IDs or alternatively use GTA SA Prineside ID lookup)

Just for reference, script from that resource separately:

function replaceModel()
	txd = engineLoadTXD("559.txd")
	engineImportTXD(txd, 559)

	dff = engineLoadDFF("559.dff")
	engineReplaceModel(dff, 559)
end
addEventHandler("onClientResourceStart", resourceRoot, replaceModel)

setTimer(function()
	-- rear bumper upgrades
	dff = engineLoadDFF("tuning/rbmp_a_j.dff")
	engineReplaceModel(dff, 1159)

	dff = engineLoadDFF("tuning/rbmp_c_j.dff")
	engineReplaceModel(dff, 1161)

	-- front bumper upgrades
	dff = engineLoadDFF("tuning/fbmp_a_j.dff")
	engineReplaceModel(dff, 1160)

	dff = engineLoadDFF("tuning/fbmp_c_j.dff")
	engineReplaceModel(dff, 1173)
end, 5000, 1)

After replacing upgrade parts with your desired custom model, all you need to do is use addVehicleUpgrade (with the ID of where you applied the mod to) as @Tekken mentioned.

  • Thanks 1
Link to comment
18 minutes ago, Dutchman101 said:

Mixing upgrade parts from different cars will obviously produce wrong results or crash the game, as they aren't made for eachother.

You should already be able to do what you have in mind (with replacing upgrade parts / loading custom upgrade parts made for that vehicle which you're applying them to). Often it's even neccesary, as GTA vehicle mods sites offer many models that come with multiple smaller DFF files, which are the upgrade parts designed for their mod, so you'll need to 'port' them to MTA by using a script that replaces it all.

You can better understand this stuff after inspecting this example resource that i uploaded: https://community.multitheftauto.com/index.php?p=resources&s=details&id=18483

Just look at the code and files. It's a Jester mod, that also loads various upgrade parts, such as rear and front bumper. It's a piece of cake, and you don't need to be messing about with anything like carmods.dat

Anyways, if you really want to "put Jester front bumper on a Sultan" (no matter how visually crippled that will look), in theory you would need to export the bumper part of Jester (e.g rbmp_c_j.dff, using Alci IMG tool) and load it onto the Jester as its own front bumper (ID 1169, fbmp_a_s.dff) simply by replacing the Sultan bumper model with the desired bumper upgrade part, in the same way as the above example resource does it.

Just for reference, script from that resource separately:


function replaceModel()
	txd = engineLoadTXD("559.txd")
	engineImportTXD(txd, 559)

	dff = engineLoadDFF("559.dff")
	engineReplaceModel(dff, 559)
end
addEventHandler("onClientResourceStart", resourceRoot, replaceModel)

setTimer(function()
	-- rear bumper upgrades
	dff = engineLoadDFF("tuning/rbmp_a_j.dff")
	engineReplaceModel(dff, 1159)

	dff = engineLoadDFF("tuning/rbmp_c_j.dff")
	engineReplaceModel(dff, 1161)

	-- front bumper upgrades
	dff = engineLoadDFF("tuning/fbmp_a_j.dff")
	engineReplaceModel(dff, 1160)

	dff = engineLoadDFF("tuning/fbmp_c_j.dff")
	engineReplaceModel(dff, 1173)
end, 5000, 1)

After replacing upgrade parts with your desired custom model, all you need to do is use addVehicleUpgrade (with the ID of where you applied the mod to) as @Tekken mentioned.

Yeah, I know I can replace tuning parts, I have two similiar custom car models with tuning parts but I wanted to know if is possible to use bumpers from different cars so I could have more parts.

Link to comment
  • MTA Anti-Cheat Team
8 minutes ago, ivan8065 said:

but I wanted to know if is possible to use bumpers from different cars so I could have more parts.

You probably gotta wait for MTA to lift some limits (when it comes to dynamic ID assignment, thus unlimited) that already got done on various types of models, but can easily be done for upgrade parts in the near future as well. Even though some development manpower is delegated to that sort of stuff (with several related drafts/pull requests open) maybe it would be helpful if you add another issue to tracker specifically for this.

Currently, applying GTA upgrade parts is limited to the upgrade part IDs bound to that vehicle (as i described in my first post) which means there's just a few IDs to mod or apply per vehicle that supports tuning.. however, some servers have worked around it by using custom upgrade part systems, that don't utilize upgrade part IDs at all (more like attach a custom bumper to where it's supposed to be). If you're a scripter you should be able to figure out how to implement such a thing.

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