Jump to content

Loading original car handling


hazard

Recommended Posts

Hey, Is there any way to make a script which automatically changes car handlings to default GTA ones when a player enters the server?

Similar to anti-carmod, like this:

function replaceModel()  
  txd = engineLoadTXD("cheetah.txd", 425 ) 
  engineImportTXD(dff, 425) 
  dff = engineLoadDFF("cheetah.dff", 425 ) 
  engineReplaceModel(dff, 425) 
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) 
  
addCommandHandler ( "reloadcar", replaceModel ) 

I tried this script, but i couldn't get it to work in my server:

vehicleIDS = { 415 } 
  
function changeHandling ( ) 
    for _, model in ipairs ( vehicleIDS ) do 
setVehicleHandling(veh, "mass", 3400.0) 
setVehicleHandling(veh, "turnMass", 5700.0) 
setVehicleHandling(veh, "dragCoeff", 0.0) 
setVehicleHandling(veh, "centerOfMass", { 0.0, 0.0, -0.2 } ) 
        end 
    end 
    addEventHandler ( "onResourceStart", resourceRoot, changeHandling ) 

Link to comment
Hey, Is there any way to make a script which automatically changes car handlings to default GTA ones when a player enters the server?

Similar to anti-carmod, like this:

function replaceModel()  
  txd = engineLoadTXD("cheetah.txd", 425 ) 
  engineImportTXD(dff, 425) 
  dff = engineLoadDFF("cheetah.dff", 425 ) 
  engineReplaceModel(dff, 425) 
end 
addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) 
  
addCommandHandler ( "reloadcar", replaceModel ) 

I tried this script, but i couldn't get it to work in my server:

vehicleIDS = { 415 } 
  
function changeHandling ( ) 
    for _, model in ipairs ( vehicleIDS ) do 
setVehicleHandling(veh, "mass", 3400.0) 
setVehicleHandling(veh, "turnMass", 5700.0) 
setVehicleHandling(veh, "dragCoeff", 0.0) 
setVehicleHandling(veh, "centerOfMass", { 0.0, 0.0, -0.2 } ) 
        end 
    end 
    addEventHandler ( "onResourceStart", resourceRoot, changeHandling ) 

According to the wiki all you need is:

setVehicleHandling ( element theVehicle, true )   -- Reset all properties to GTA default value

Try to use Event OnPlayerVehicleEnter for that.

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