RedM Natives

SET_VISUAL_SETTING_FLOAT

Overrides a floating point value from visualsettings.dat temporarily.

Hash0xD1D31681
Runtime nameSetVisualSettingFloat
NamespaceCFX
SideClient
NameOfficial
Docs

Signature

void SET_VISUAL_SETTING_FLOAT(char* name, float value);

Parameters

NameTypeDescription
namechar*

The name of the value to set, such as pedLight.color.red.

valuefloat

The value to write.

Returns void

Description

Cfx.re native reference

Overrides a floating point value from visualsettings.dat temporarily.

Usage

Lua
SetVisualSettingFloat(name, value)

-- always works, by hash
Citizen.InvokeNative(0xd1d31681, name, value)
JavaScript and C#
JavaScript
SetVisualSettingFloat(name, value);

// by hash
Citizen.invokeNative('0xd1d31681', name, value + 0.0000001);
C#
Function.Call((Hash)0xd1d31681, name, value);
  • 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.