oldnag Posted April 5, 2013 Share Posted April 5, 2013 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
oldnag Posted April 5, 2013 Author Share Posted April 5, 2013 as i want to change a few cars Link to comment
xXMADEXx Posted April 5, 2013 Share Posted April 5, 2013 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
oldnag Posted April 5, 2013 Author Share Posted April 5, 2013 nah mate the car still the same as standard Link to comment
oldnag Posted April 6, 2013 Author Share Posted April 6, 2013 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 Link to comment
mjau Posted April 6, 2013 Share Posted April 6, 2013 Replace setVehicleHandling with https://wiki.multitheftauto.com/wiki/SetModelHandling Link to comment
PaiN^ Posted April 7, 2013 Share Posted April 7, 2013 Replace setVehicleHandling withhttps://wiki.multitheftauto.com/wiki/SetModelHandling + The first argument of setVehicleHandling is a Vehicle Element not a model or ID ! Link to comment
Castillo Posted April 7, 2013 Share Posted April 7, 2013 He said replace setVehicleHandling with setModelHandling. Link to comment
PaiN^ Posted April 7, 2013 Share Posted April 7, 2013 He said replace setVehicleHandling with setModelHandling. I know, You can see i quote that, I was just explaining .. Link to comment
mjau Posted April 7, 2013 Share Posted April 7, 2013 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
PaiN^ Posted April 7, 2013 Share Posted April 7, 2013 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
Castillo Posted April 7, 2013 Share Posted April 7, 2013 Where is he using a model ID on that code you quoted? Link to comment
PaiN^ Posted April 7, 2013 Share Posted April 7, 2013 Where is he using a model ID on that code you quoted? oh Sorry my mistake, wasn't so focused when i reed it, apologise Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now