Wiki

Clone wiki

EFLC-MP LUA / getVehicleVelocity

Description

Gets the vehicle velocity vector

Parameters

Int vehicleId
Int vehicleId: ID of the vehicle

Return values

Float vX, Float vY, Float vZ

Example

#!lua
local velocityX, velocityY, velocityZ = getVehicleVelocity(vehicleId)
local mph = math.ceil(math.sqrt(velocityX * velocityX + velocityY * velocityY + velocityY * velocityY) * 1.609)

Updated