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|Returns the vehicle's velocity}} | {{FuncDescription|Returns the vehicle's velocity vectors.}} | ||
{{FuncSyntax|GetVehicleVelocity(vehicle)}} | {{FuncSyntax|GetVehicleVelocity(vehicle)}} | ||
Line 13: | Line 13: | ||
<syntaxhighlight lang="Lua"> | <syntaxhighlight lang="Lua"> | ||
local vehicleId = GetPlayerVehicle() | local vehicleId = GetPlayerVehicle() | ||
local | local vX, vY, vZ = GetVehicleVelocity(vehicleId) | ||
AddPlayerChat("Your vehicle velocity is: ".. | AddPlayerChat("Your vehicle velocity is: "..vX..", "..vY..","..vZ..".") | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
{{Template:VehicleFunctions}} | {{Template:VehicleFunctions}} |
Latest revision as of 17:12, 6 April 2020
Description
Returns the vehicle's velocity vectors.
Syntax
GetVehicleVelocity(vehicle)
Parameters
- vehicle
The vehicle identifier
Return Value
- This function returns the velocity of your vehicle.
Example
local vehicleId = GetPlayerVehicle()
local vX, vY, vZ = GetVehicleVelocity(vehicleId)
AddPlayerChat("Your vehicle velocity is: "..vX..", "..vY..","..vZ..".")
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