TorNix~|nR Posted April 19, 2017 Share Posted April 19, 2017 Hello guys, I have a freeroam server, I want to make the vehicles run more faster (speed) than usual Help please? Link to comment
Amine#TN Posted April 19, 2017 Share Posted April 19, 2017 (edited) function handlingChange() setModelHandling(490, "maxVelocity", 900) end addEventHandler("onResourceStart", resourceRoot, handlingChange) Edited April 19, 2017 by NOONE just for more fun Link to comment
TorNix~|nR Posted April 19, 2017 Author Share Posted April 19, 2017 not worked guys! I want to make more speed for all vehicles, not max km/h Help please? Link to comment
#BrosS Posted April 19, 2017 Share Posted April 19, 2017 (edited) function SetSpeed() for k,v in ipairs(getElementsByType("vehicle")) do vehs = getElementModel(v) setModelHandling(vehs, "maxVelocity", 900) end end addEventHandler("onResourceStart", resourceRoot,SetSpeed) not tested but it sould work Edited April 19, 2017 by #BrosS 1 Link to comment
TorNix~|nR Posted April 19, 2017 Author Share Posted April 19, 2017 I want to boost the vehicle not sex max velocity, help? Link to comment
NeXuS™ Posted April 19, 2017 Share Posted April 19, 2017 Do you mean give it a little boost on a specific button press? 1 Link to comment
TorNix~|nR Posted April 19, 2017 Author Share Posted April 19, 2017 @NeXuS™ true, but I want it automatic not with specific button press? help please? Link to comment
NeXuS™ Posted April 19, 2017 Share Posted April 19, 2017 And on what event should it happen? Marker hit? Timer? 1 Link to comment
TorNix~|nR Posted April 19, 2017 Author Share Posted April 19, 2017 when you enter a vehicle and run, it boost the speed automatically, that's what I mean can you help please? Link to comment
#BrosS Posted April 19, 2017 Share Posted April 19, 2017 9 minutes ago, TorNix~|nR said: I want to boost the vehicle not sex max velocity, help? sex ? ( ͡° ͜ʖ ͡°) you can use "engineAcceleration" then 1 Link to comment
TorNix~|nR Posted April 19, 2017 Author Share Posted April 19, 2017 #BrosS sorry for that #BrosS sorry for that word I made it, it works fine, but there is a little thing I want to remove, on engineAcceleration the vehicle drifts, I want only speed not drift, any help please? Code: function SetSpeed() for k,v in ipairs(getElementsByType("vehicle")) do vehs = getElementModel(v) setModelHandling(vehs, "engineAcceleration", 50) end end addEventHandler("onResourceStart", resourceRoot,SetSpeed) function RemoveSpeed() for k,v in ipairs(getElementsByType("vehicle")) do vehs = getElementModel(v) setModelHandling(vehs, "engineAcceleration", nil) end end addEventHandler("onResourceStop", resourceRoot,RemoveSpeed) Link to comment
Function Posted April 20, 2017 Share Posted April 20, 2017 (edited) function VehicleSpeed(player) local vehicle = getPedOccupiedVehicle(player) if isPedInVehicle(player) then setElementVelocity(vehicle,x,y,z) end end end setTimer(VehicleSpeed,500,0) Edited April 20, 2017 by Function 1 Link to comment
MTA Anti-Cheat Team Dutchman101 Posted April 20, 2017 MTA Anti-Cheat Team Share Posted April 20, 2017 (edited) Check this out: https://community.multitheftauto.com/index.php?p=resources&s=details&id=13636 (you can set handling for vehicles as you desire) It might even be better, as vehicles react differently to the same handling parameter tuning. You will run into problems if you just raise acceleration + max velocity for each vehicle, better make a selection for custom speed handling and on a case by case basis by that script I linked. -- For handling flags and value range refer to https://wiki.multitheftauto.com/wiki/SetModelHandling -- Add any handling value type not included below, by simply adding its string in below format followed by = value as below. Get valid strings from https://wiki.multitheftauto.com/wiki/SetModelHandling local predefinedHandling = { [411] = { ["engineAcceleration"] = 14, ["dragCoeff"] = 0, ["maxVelocity"] = 100000, ["tractionMultiplier"] = 0.9, ["tractionLoss"] = 1.1, }, [415] = { ["engineAcceleration"] = 14, ["dragCoeff"] = 0, ["maxVelocity"] = 100000, ["tractionMultiplier"] = 0.9, ["tractionLoss"] = 1.1, }, --next model below etc (copy rows) } 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 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) Also by your question it seems you don't really understand how to achieve that ''speed boost'' you're talking about, so I will give you a bit of information: - In order to have a noticable speed effect by anything (like acceleration or max velocity) you better lower the Drag Multiplier value (the performance gain from all later tweaks will increase in effect with that, setting it to 0 will give practically infinite top speed and accel that reflects the new values) After lowering the Drag multiplier, you can raise the acceleration and possibly increase max velocity (say, to 600..) and aslong you don't set Drag multiplier to 0, it won't ever reach 600kph, so dont be afraid of that as you said a good top speed isnt what you want - however it's needed because max velocity, acceleration and drag multiplier co-interact (they decide the end result where all 3 are factors, although the values wont be practically achieved unless you tweak the next bottleneck - traction..) A good generic handling (for ''speed boost'' you want) using the linked/pasted script would be this table: ["engineAcceleration"] = 23, ["dragCoeff"] = 1, ["maxVelocity"] = 700, ["tractionMultiplier"] = 0.9, ["tractionLoss"] = 1.1, Because the bottlenecks (drag mult, traction) are already improved, you can easily just increase Acceleration if you want it even faster, from that template. @TorNix~|nR Edited April 20, 2017 by Dutchman101 1 Link to comment
TorNix~|nR Posted April 20, 2017 Author Share Posted April 20, 2017 Thank you guys @Dutchman101 it works fine, thank you so much! Link to comment
TorNix~|nR Posted April 20, 2017 Author Share Posted April 20, 2017 @Dutchman101 how to make it for all vehicles? Link to comment
koragg Posted April 21, 2017 Share Posted April 21, 2017 14 hours ago, TorNix~|nR said: @Dutchman101 how to make it for all vehicles? It's best if you create a custom handling for each vehicle that you want to change it on because as @Dutchman101 already said: each vehicle reacts differently to the same value of acceleration. 1 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