SC_PRESENCE_ATTR_SET_FLOAT
Hash
0xA31DAFCDC33775E9Runtime name
ScPresenceAttrSetFloatNamespaceSOCIALCLUB
SideClient
NameOfficial
Docs
Since build1207
GTA V hash
0xC4C4575F62534A24Not called by the game's own scripts — behaviour may be incomplete.
Signature
BOOL SC_PRESENCE_ATTR_SET_FLOAT(Hash attrHash, float value);Parameters
| Name | Type | Description |
|---|---|---|
attrHash | Hash | — |
value | float | — |
Returns BOOL
Usage
local retval = ScPresenceAttrSetFloat(attrHash, value)
-- always works, by hash
local retval = Citizen.InvokeNative(0xA31DAFCDC33775E9, attrHash, value, Citizen.ReturnResultAnyway())JavaScript and C#
const retval = ScPresenceAttrSetFloat(attrHash, value);
// by hash
const retval = Citizen.invokeNative('0xA31DAFCDC33775E9', attrHash, value + 0.0000001, Citizen.returnResultAnyway());bool retval = Function.Call<bool>((Hash)0xA31DAFCDC33775E9, attrHash, value);- Hash parameters: the named function also accepts a string and hashes it for you;
Citizen.InvokeNativeneeds the number — passjoaat("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. Write10.0orvalue + 0.0. The generated JS wrappers add0.0000001to non-zero floats for the same reason.
Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.