RedM Natives

SET_ENTITY_HEADING

Set the heading of an entity in degrees also known as "Yaw".

Hash0xE0FF064D
Runtime nameSetEntityHeading
NamespaceCFX
SideServer
NameOfficial
Docs

Signature

void SET_ENTITY_HEADING(Entity entity, float heading);

Parameters

NameTypeDescription
entityEntity

The entity to set the heading for.

headingfloat

The heading in degrees.

Returns void

Description

Cfx.re native reference

Set the heading of an entity in degrees also known as "Yaw".

This is the server-side RPC native equivalent of the client native SET_ENTITY_HEADING.

Usage

Lua
SetEntityHeading(entity, heading)

-- always works, by hash
Citizen.InvokeNative(0xe0ff064d, entity, heading)
JavaScript and C#
JavaScript
SetEntityHeading(entity, heading);

// by hash
Citizen.invokeNative('0xe0ff064d', entity, heading + 0.0000001);
C#
Function.Call((Hash)0xe0ff064d, entity, heading);
  • Float parameters: Lua integers (10, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write 10.0 or value + 0.0. The generated JS wrappers add 0.0000001 to non-zero floats for the same reason.

See also

Sources

Cfx.re native reference

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.