Jump to content

handling line


oldnag

Recommended Posts

Posted

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) 

Posted

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 
) 

Posted

please someone can help me i really cant get this to work, or how do i get the handling.cfg to work so when ppl join the veh stats are what i set them i tryd the way thats on wiki but that way doesnt work

Posted

He said replace setVehicleHandling with setModelHandling.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
He said replace setVehicleHandling with setModelHandling.

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

" Keep Thinking Different . " - Steve Jops

--------------------

Don't send me PMs asking for help, I Won't reply !

Posted
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(...)

n-560x95_E60303_FFFFFF_030303_FF0303.png
Posted
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 ..

" Keep Thinking Different . " - Steve Jops

--------------------

Don't send me PMs asking for help, I Won't reply !

Posted

Where is he using a model ID on that code you quoted?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
Where is he using a model ID on that code you quoted?

oh o.O

Sorry my mistake, wasn't so focused when i reed it, apologise :roll:

" Keep Thinking Different . " - Steve Jops

--------------------

Don't send me PMs asking for help, I Won't reply !

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