Jump to content

Replacing collisions on a car


diegofkda

Recommended Posts

Well, I want to change the collisions of some cars (using embedded collisions), this is what the wiki says for that:

Note: Due to a bug, when replacing models with built in collisions (i.e. vehicles), the collision may not get replaced correctly. The current work around is to load the dff again and do another replace after a short delay.

And my script is this one:

vehiclesToReplace = {"huntley", "comet", "elegant", "bullet", "bravura", "cadrona", "jester", "esperanto", "stallion", "zr-350", "flash"}   
  
function replaceModels() 
    for name, value in ipairs ( vehiclesToReplace ) do 
        txd = engineLoadTXD ( value..".txd" ) 
        engineImportTXD ( txd, getVehicleModelFromName ( tostring(value) ) ) 
  
        dff = engineLoadDFF ( value..".dff", getVehicleModelFromName ( tostring(value) ) ) 
        engineReplaceModel ( dff, getVehicleModelFromName ( tostring(value) ) ) 
        dff1 = engineLoadDFF ( value..".dff", getVehicleModelFromName ( tostring(value) ) ) 
        engineReplaceModel ( dff1, getVehicleModelFromName ( tostring(value) ) ) 
    end 
end 
addEventHandler ( "onClientResourceStart", resourceRoot, replaceModels ) 

The DFF gets replaced correctly while the collision not, what should I do if I'm following wiki steps?.

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