Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- addEventHandler("onClientResourceStart", resourceRoot, function ()
- Maccer = 2
- bobcat = 422
- manana = 410
- primo = 547
- sentinel = 405
- local predefinedHandling = {
- [bobcat] = {
- ["mass"] = 1700.0,
- ["turnMass"] = 4000.0,
- ["dragCoeff"] = 2.5,
- ["centerOfMass"] = {0.0, 0.05, -0.2},
- ["percentSubmerged"] = 75,
- ["tractionMultiplier"] = 0.65,
- ["tractionLoss"] = 0.85,
- ["tractionBias"] = 0.57,
- ["numberOfGears"] = 5,
- ["maxVelocity"] = 165.0,
- ["engineAcceleration"] = 20.0,
- ["engineInertia"] = 15.0,
- ["driveType"] = "awd",
- ["engineType"] = "diesel",
- ["brakeDeceleration"] = 8.5,
- ["brakeBias"] = 0.5,
- ["steeringLock"] = 35.0,
- ["suspensionForceLevel"] = 1.5,
- ["suspensionDamping"] = 0.10,
- ["suspensionHighSpeedDamping"] = 5.0,
- ["suspensionUpperLimit"] = 0.35,
- ["suspensionLowerLimit"] = -0.18,
- ["suspensionFrontRearBias"] = 0.4,
- ["suspensionAntiDiveMultiplier"] = 0.0,
- ["seatOffsetDistance"] = 0.26,
- ["collisionDamageMultiplier"] = 0.20,
- },
- [sentinel] = {
- ["mass"] = 1900.0,
- ["turnMass"] = 4529.9,
- ["dragCoeff"] = 2.0,
- ["centerOfMass"] = {0.0, 0.0, 0.0},
- ["percentSubmerged"] = 75,
- ["tractionMultiplier"] = 0.67,
- ["tractionLoss"] = 0.75,
- ["tractionBias"] = 0.52,
- ["numberOfGears"] = 5,
- ["maxVelocity"] = 160.0,
- ["engineAcceleration"] = 16.0,
- ["engineInertia"] = 15.0,
- ["driveType"] = "rwd",
- ["engineType"] = "petrol",
- ["brakeDeceleration"] = 5.0,
- ["brakeBias"] = 0.55,
- ["steeringLock"] = 30.0,
- ["suspensionForceLevel"] = 1.0,
- ["suspensionDamping"] = 0.1,
- ["suspensionHighSpeedDamping"] = 0.0,
- ["suspensionUpperLimit"] = 0.35,
- ["suspensionLowerLimit"] = -0.17,
- ["suspensionFrontRearBias"] = 0.5,
- ["suspensionAntiDiveMultiplier"] = 0.5,
- ["seatOffsetDistance"] = 0.23,
- ["collisionDamageMultiplier"] = 0.45,
- -- ["modelFlags"] = 20000,
- },
- [manana] = {
- ["mass"] = 1600.0,
- ["turnMass"] = 4500.0,
- ["dragCoeff"] = 2.2,
- ["centerOfMass"] = {0.0, 0.0, -0.6},
- ["percentSubmerged"] = 70,
- ["tractionMultiplier"] = 0.75,
- ["tractionLoss"] = 0.9,
- ["tractionBias"] = 0.5,
- ["numberOfGears"] = 5,
- ["maxVelocity"] = 320.0,
- ["engineAcceleration"] = 18.0,
- ["engineInertia"] = 10.0,
- ["driveType"] = "rwd",
- ["engineType"] = "petrol",
- ["brakeDeceleration"] = 8.0,
- ["brakeBias"] = 0.5,
- ["steeringLock"] = 30.0,
- ["suspensionForceLevel"] = 0.7,
- ["suspensionDamping"] = 0.08,
- ["suspensionHighSpeedDamping"] = 0.0,
- ["suspensionUpperLimit"] = 0.35,
- ["suspensionLowerLimit"] = -0.31,
- ["suspensionFrontRearBias"] = 0.5,
- ["suspensionAntiDiveMultiplier"] = 0.0,
- ["seatOffsetDistance"] = 0.38,
- ["collisionDamageMultiplier"] = 0.35,
- ["modelFlags"] = 0x0,
- ["handlingFlags"] = 0x1310003,
- },
- [primo] = {
- ["mass"] = 1600.0,
- ["turnMass"] = 3300.0,
- ["dragCoeff"] = 2.2,
- ["centerOfMass"] = {0.0, 0.0, 0.0},
- ["percentSubmerged"] = 70,
- ["tractionMultiplier"] = 0.70,
- ["tractionLoss"] = 0.8,
- ["tractionBias"] = 0.54,
- ["numberOfGears"] = 4,
- ["maxVelocity"] = 160.0,
- ["engineAcceleration"] = 18.0,
- ["engineInertia"] = 7.0,
- ["driveType"] = "rwd",
- ["engineType"] = "petrol",
- ["brakeDeceleration"] = 5.4,
- ["brakeBias"] = 0.60,
- ["steeringLock"] = 30.0,
- ["suspensionForceLevel"] = 1.1,
- ["suspensionDamping"] = 0.14,
- ["suspensionHighSpeedDamping"] = 0.0,
- ["suspensionUpperLimit"] = 0.32,
- ["suspensionLowerLimit"] = -0.14,
- ["suspensionFrontRearBias"] = 0.5,
- ["suspensionAntiDiveMultiplier"] = 0.0,
- ["seatOffsetDistance"] = 0.26,
- ["collisionDamageMultiplier"] = 0.54,
- },
- }
- for i, v in pairs (predefinedHandling) do
- if i then
- for handling, value in pairs(v) do
- if not setModelHandling (i, handling, value) then
- outputDebugString ("* Predefined handling '"..tostring(handling).."' for vehicle model '"..tostring(i).."' could not be set to '"..tostring(value).."'")
- end
- end
- end
- end
- for _,v in ipairs (getElementsByType("vehicle")) do
- if v and predefinedHandling[getElementModel(v)] then
- for k,vl in pairs (predefinedHandling[getElementModel(v)]) do
- setVehicleHandling (v, k, vl)
- end
- end
- end
- end);
- function resetHandling()
- for model in pairs(predefinedHandling) do
- if model then
- for k in pairs(getOriginalHandling(model)) do
- setModelHandling(model, k, nil)
- end
- end
- end
- for _,v in ipairs(getElementsByType("vehicle")) do
- if v then
- local model = getElementModel(v)
- if predefinedHandling[model] then
- for k,h in pairs(getOriginalHandling(model)) do
- setVehicleHandling(v, k, h)
- end
- end
- end
- end
- end
- addEventHandler("onResourceStop", resourceRoot, resetHandling)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement