Stats::statSetInt

From RAGE Multiplayer Wiki
Jump to navigation Jump to search

Add Cash example:
for (int i = 0; i < 3; i++)
{
char statNameFull[32];
sprintf_s(statNameFull, 'SP%d_TOTAL_CASH', i);
Hash hash = GAMEPLAY::GET_HASH_KEY(statNameFull);
int val;
STATS::STAT_GET_INT(hash, &val, -1);
val += 1000000;
STATS::STAT_SET_INT(hash, val, 1);
}

Syntax

mp.game.stats.statSetInt(statName, value, save);

Required Arguments

  • statName: Model hash or name
  • value: int
  • save: Boolean

Return value

  • Boolean

Example

mp.game.stats.statSetInt(mp.game.joaat("SP0_TOTAL_CASH"), 1000, false);

See also

Template:Stats s function c