Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local jobVehHandling = {
- [456] = "YANKEE 4500 18003.699 3 0 0 0 80 0.7 0.7 0.48 5 160 10 40 r d 4.5 0.8 false 30 1.8 0.12 0 0.3 -0.1 0.4 0 0.35 0.45 22000 4088 1 0 1 0",
- }
- local handlingNamesTable =
- {
- "mass","turnMass","dragCoeff","centerOfMassX","centerOfMassY","centerOfMassZ","percentSubmerged","tractionMultiplier","tractionLoss", "tractionBias", "numberOfGears","maxVelocity","engineAcceleration","engineInertia",
- "driveType","engineType","brakeDeceleration","brakeBias","ABS","steeringLock","suspensionForceLevel","suspensionDamping","suspensionHighSpeedDamping","suspensionUpperLimit",
- "suspensionLowerLimit","suspensionFrontRearBias","suspensionAntiDiveMultiplier","seatOffsetDistance","collisionDamageMultiplier","monetary","modelFlags","handlingFlags"
- }
- function setVehicleHandlings(veh)
- if veh and isElement(veh) then
- if not jobVehHandling[getElementModel(veh)] then return end
- local strArray = {}
- for token in string.gmatch(jobVehHandling[getElementModel(veh)], "[^%s]+") do
- table.insert(strArray,token)
- end
- local i = 2
- for k,v in pairs(handlingNamesTable) do
- setVehicleHandling(veh, v, strArray[i])
- if v == "modelFlags" or v == "handlingFlags" then
- setVehicleHandling(veh, v, tonumber("0x"..strArray[i]))
- elseif v == "driveType" then
- if strArray[i] == "4" then
- setVehicleHandling(veh, v, "awd")
- elseif strArray[i] == "f" then
- setVehicleHandling(veh, v, "fwd")
- elseif strArray[i] == "r" then
- setVehicleHandling(veh, v, "rwd")
- end
- end
- i = i + 1
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement