GetVehicleVelocity: Difference between revisions
From Onset Developer Wiki
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{Info|Function|Server & Client|1.0}} | {{Info|Function|Server & Client|1.0}} | ||
{{FuncDescription| | {{FuncDescription|Returns the vehicle's velocity}} | ||
{{FuncSyntax|GetVehicleVelocity(vehicle)}} | {{FuncSyntax|GetVehicleVelocity(vehicle)}} | ||
{{FuncParameters}} | {{FuncParameters}} | ||
{{FuncParam|vehicle| | {{FuncParam|vehicle|The vehicle identifier}} | ||
{{FuncReturnValue| | {{FuncReturnValue|This function returns the velocity of your vehicle.}} | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua"> | |||
local vehicleId = GetPlayerVehicle() | |||
local velocity = GetVehicleVelocity(vehicleId) | |||
AddPlayerChat("Your vehicle velocity is: "..velocity..".") | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
{{Template:VehicleFunctions}} |
Revision as of 09:50, 12 December 2019
Description
Returns the vehicle's velocity
Syntax
GetVehicleVelocity(vehicle)
Parameters
- vehicle
The vehicle identifier
Return Value
- This function returns the velocity of your vehicle.
Example
local vehicleId = GetPlayerVehicle()
local velocity = GetVehicleVelocity(vehicleId)
AddPlayerChat("Your vehicle velocity is: "..velocity..".")
See also
- CreateVehicle
- DestroyVehicle
- IsValidVehicle
- GetVehicleCount
- GetAllVehicles
- GetVehicleModel
- GetVehicleModelName
- SetVehicleRespawnParams
- IsVehicleStreamedIn
- GetStreamedVehiclesForPlayer
- GetStreamedVehicles
- SetVehicleLocation
- GetVehicleLocation
- SetVehicleRotation
- GetVehicleRotation
- SetVehicleHeading
- GetVehicleHeading
- SetVehicleHealth
- GetVehicleHealth
- SetVehicleLicensePlate
- GetVehicleVelocity
- GetVehicleDriver
- GetVehiclePassenger
- GetVehicleNumberOfSeats
- SetVehicleColor
- GetVehicleColor
- SetVehicleLinearVelocity
- SetVehicleAngularVelocity
- GetVehicleGear
- SetVehicleHoodRatio
- GetVehicleHoodRatio
- SetVehicleTrunkRatio
- GetVehicleTrunkRatio
- StartVehicleEngine
- StopVehicleEngine
- GetVehicleEngineState
- SetVehicleLightEnabled
- GetVehicleLightState
- SetVehicleDamage
- GetVehicleDamage
- AttachVehicleNitro