Jacobob14 Posted March 12, 2014 Share Posted March 12, 2014 hi all I have a problem only shows me the speed when I'm not in a vehicle local speedx, speedy, speedz = getElementVelocity ( localPlayer ) actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) local kmh = actualspeed * 180 Link to comment
pa3ck Posted March 12, 2014 Share Posted March 12, 2014 Because you need to get the velocity of the vehicle you are in. Link to comment
Saml1er Posted March 12, 2014 Share Posted March 12, 2014 local speedx, speedy, speedz = getElementVelocity (getPedOccupiedVehicle( localPlayer )) actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) local kmh = actualspeed * 180 Link to comment
Jacobob14 Posted March 12, 2014 Author Share Posted March 12, 2014 local speedx, speedy, speedz = getElementVelocity (getPedOccupiedVehicle( localPlayer )) actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) local kmh = actualspeed * 180 thanks Link to comment
Saml1er Posted March 12, 2014 Share Posted March 12, 2014 local speedx, speedy, speedz = getElementVelocity (getPedOccupiedVehicle( localPlayer )) actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) local kmh = actualspeed * 180 thanks You might get the speed in decimal so use this. local kmh = math.ceil (actualspeed * 180 ) 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