oldnag Posted April 5, 2013 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)
xXMADEXx Posted April 5, 2013 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 )
oldnag Posted April 6, 2013 Author 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
mjau Posted April 6, 2013 Posted April 6, 2013 Replace setVehicleHandling with https://wiki.multitheftauto.com/wiki/SetModelHandling
PaiN^ Posted April 7, 2013 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 !
Castillo Posted April 7, 2013 Posted April 7, 2013 He said replace setVehicleHandling with setModelHandling.
PaiN^ Posted April 7, 2013 Posted April 7, 2013 He said replace setVehicleHandling with setModelHandling. I know, You can see i quote that, I was just explaining ..
mjau Posted April 7, 2013 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(...)
PaiN^ Posted April 7, 2013 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 ..
Castillo Posted April 7, 2013 Posted April 7, 2013 Where is he using a model ID on that code you quoted?
PaiN^ Posted April 7, 2013 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
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