bandi94 Posted July 8, 2011 Share Posted July 8, 2011 i search on wiki some functions that set a car max speed (for my rpm+gear meter i wanna too make a manual gearbox if you writ /manualgear in chatbox) the problem is that function i found on wiki is only server side i need some client side function to set max speed for a car Link to comment
Buffalo Posted July 8, 2011 Share Posted July 8, 2011 (edited) There is no function like that client-side, but instead you can use setElementVelocity as work-around: local speed = 50 function limitSpeed() local myveh = getPedOccupiedVehicle(getLocalPlayer()) local vx,vy,vz = getElementVelocity(myveh) if getSpeed(vx,vy,vz) > speed then setElementVelocity(myveh,vx/1.05,vy/1.05,vz/1.05)--apply smooth speed limit end end addEventHandler('onClientRender',getRootElement(),limitSpeed) function getSpeed( x,y,z ) return math.sqrt(x^2 + y^2 + z^2) * 161 end Edited July 8, 2011 by Guest Link to comment
bandi94 Posted July 8, 2011 Author Share Posted July 8, 2011 thx man i will work around this when i finish it i will update my rpmandgear whit manual gearbox function 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