GET_ENTITY_SPEED
Gets the current speed of the entity in meters per second.
Signature
float GET_ENTITY_SPEED(Entity entity);Parameters
| Name | Type | Description |
|---|---|---|
entity | Entity | The entity to get the speed of |
Returns float — The speed of the entity in meters per second
Description
Gets the current speed of the entity in meters per second.
To convert to MPH: speed * 2.236936
To convert to KPH: speed * 3.6Usage
local retval = GetEntitySpeed(entity)
-- always works, by hash
local retval = Citizen.InvokeNative(0x9e1e4798, entity, Citizen.ResultAsFloat())JavaScript and C#
const retval = GetEntitySpeed(entity);
// by hash
const retval = Citizen.invokeNative('0x9e1e4798', entity, Citizen.returnResultAnyway(), Citizen.resultAsFloat());float retval = Function.Call<float>((Hash)0x9e1e4798, entity);Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.