RedM Natives

SC_PRESENCE_ATTR_SET_FLOAT

Hash0xA31DAFCDC33775E9
Runtime nameScPresenceAttrSetFloat
NamespaceSOCIALCLUB
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0xC4C4575F62534A24

Not called by the game's own scripts — behaviour may be incomplete.

Signature

BOOL SC_PRESENCE_ATTR_SET_FLOAT(Hash attrHash, float value);

Parameters

NameTypeDescription
attrHashHash—
valuefloat—

Returns BOOL

Usage

Lua
local retval = ScPresenceAttrSetFloat(attrHash, value)

-- always works, by hash
local retval = Citizen.InvokeNative(0xA31DAFCDC33775E9, attrHash, value, Citizen.ReturnResultAnyway())
JavaScript and C#
JavaScript
const retval = ScPresenceAttrSetFloat(attrHash, value);

// by hash
const retval = Citizen.invokeNative('0xA31DAFCDC33775E9', attrHash, value + 0.0000001, Citizen.returnResultAnyway());
C#
bool retval = Function.Call<bool>((Hash)0xA31DAFCDC33775E9, attrHash, value);
  • Hash parameters: the named function also accepts a string and hashes it for you; Citizen.InvokeNative needs the number — pass joaat("name") or a backtick literal like `name`.
  • 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.

Sources

alloc8or RDR3 NativeDB

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