Jump to content

handling line


oldnag

Recommended Posts

ok so i put the handling line to lua converter and just wondering if in the "veh" do i put the car id for it to work or do i need more code here is what i have

setVehicleHandling(veh, "mass", 1500) 
setVehicleHandling(veh, "turnMass", 4000) 
setVehicleHandling(veh, "dragCoeff", 2.2) 
setVehicleHandling(veh, "centerOfMass", { 0, 0.3, -0.15 } ) 
setVehicleHandling(veh, "percentSubmerged", 85) 
setVehicleHandling(veh, "tractionMultiplier", 0.7) 
setVehicleHandling(veh, "tractionLoss", 0.9) 
setVehicleHandling(veh, "tractionBias", 0.52) 
setVehicleHandling(veh, "numberOfGears", 5) 
setVehicleHandling(veh, "maxVelocity", 200) 
setVehicleHandling(veh, "engineAcceleration", 22) 
setVehicleHandling(veh, "engineInertia", 5) 
setVehicleHandling(veh, "driveType", "awd") 
setVehicleHandling(veh, "engineType", "petrol") 
setVehicleHandling(veh, "brakeDeceleration", 6) 
setVehicleHandling(veh, "brakeBias", 0.55) 

Link to comment

Im pretty sure this will work...

addEventHandler("onResourceStart",resourceRoot, 
function () 
for i,veh in ipairs (getElementsByType("vehicle")) do 
if (getVehicleModelFromName(getVehicleName(veh))==--[[vehicle ID here]]) then 
    setVehicleHandling(veh, "mass", 1500) 
    setVehicleHandling(veh, "turnMass", 4000) 
    setVehicleHandling(veh, "dragCoeff", 2.2) 
    setVehicleHandling(veh, "centerOfMass", { 0, 0.3, -0.15 } ) 
    setVehicleHandling(veh, "percentSubmerged", 85) 
    setVehicleHandling(veh, "tractionMultiplier", 0.7) 
    setVehicleHandling(veh, "tractionLoss", 0.9) 
    setVehicleHandling(veh, "tractionBias", 0.52) 
    setVehicleHandling(veh, "numberOfGears", 5) 
    setVehicleHandling(veh, "maxVelocity", 200) 
    setVehicleHandling(veh, "engineAcceleration", 22) 
    setVehicleHandling(veh, "engineInertia", 5) 
    setVehicleHandling(veh, "driveType", "awd") 
    setVehicleHandling(veh, "engineType", "petrol") 
    setVehicleHandling(veh, "brakeDeceleration", 6) 
    setVehicleHandling(veh, "brakeBias", 0.55) 
end 
end 
end 
) 

Link to comment
He said replace setVehicleHandling with setModelHandling.

I know, You can see i quote that, I was just explaining ..

Exactly what were you explaining, i use this in my server and it works perfectly fine.

This makes every car of the model 411 get the handling

function infernus() 
local veh = 411 
setModelHandling(veh, "mass", 1500) 
setModelHandling(veh, "turnMass", 4000) 
setModelHandling(veh, "dragCoeff", 2.2) 
setModelHandling(veh, "centerOfMass", { 0, 0.3, -0.15 } ) 
setModelHandling(veh, "percentSubmerged", 85) 
setModelHandling(veh, "tractionMultiplier", 0.7) 
setModelHandling(veh, "tractionLoss", 0.9) 
setModelHandling(veh, "tractionBias", 0.52) 
setModelHandling(veh, "numberOfGears", 5) 
setModelHandling(veh, "maxVelocity", 200) 
setModelHandling(veh, "engineAcceleration", 22) 
setModelHandling(veh, "engineInertia", 5) 
setModelHandling(veh, "driveType", "awd") 
setModelHandling(veh, "engineType", "petrol") 
setModelHandling(veh, "brakeDeceleration", 6) 
setModelHandling(veh, "brakeBias", 0.55) 
end 
addEventHandler ("onResourceStart", getResourceRootElement(getThisResource()), infernus) 

If you want it to only change for a few cars u use setVehicleHandling and the first argument is the vehicle element, you can create the vehicle in the script like veh = createVehicle(...)

Link to comment
Exactly what were you explaining ...

I was explaining the setVehicleHandling function, because they were trying to do it with a model and not a vehicle element !

addEventHandler("onResourceStart",resourceRoot, 
function () 
for i,veh in ipairs (getElementsByType("vehicle")) do 
if (getVehicleModelFromName(getVehicleName(veh))==--[[vehicle ID here]]) then 
    setVehicleHandling(veh, "mass", 1500) 
    setVehicleHandling(veh, "turnMass", 4000) 
    setVehicleHandling(veh, "dragCoeff", 2.2) 
    setVehicleHandling(veh, "centerOfMass", { 0, 0.3, -0.15 } ) 
    setVehicleHandling(veh, "percentSubmerged", 85) 
    setVehicleHandling(veh, "tractionMultiplier", 0.7) 
    setVehicleHandling(veh, "tractionLoss", 0.9) 
    setVehicleHandling(veh, "tractionBias", 0.52) 
    setVehicleHandling(veh, "numberOfGears", 5) 
    setVehicleHandling(veh, "maxVelocity", 200) 
    setVehicleHandling(veh, "engineAcceleration", 22) 
    setVehicleHandling(veh, "engineInertia", 5) 
    setVehicleHandling(veh, "driveType", "awd") 
    setVehicleHandling(veh, "engineType", "petrol") 
    setVehicleHandling(veh, "brakeDeceleration", 6) 
    setVehicleHandling(veh, "brakeBias", 0.55) 
end 
end 
end 
) 

I know that he should use setModelHandling for what he wants ..

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