GetVehicleForwardSpeed

From Onset Developer Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
GetVehicleForwardSpeed

Type: Function
Context: Client
Introduced: v1.0

Description

Returns the vehicle's forward moving speed. Negative when the vehicle is moving backwards.

Syntax

GetVehicleForwardSpeed(vehicle)

Parameters

  • vehicle
    The vehicle identifier

Return Value

  • Returns positive value if the vehicle is moving forward, otherwise negative.

Example

local speed = math.tointeger(math.floor(GetVehicleForwardSpeed(GetPlayerVehicle())))
AddPlayerChat("Speed: "..speed.." km/h")

See also

__EDIT_ME__