The Lab
PLAYER native

_SET_PLAYER_DEFENSE_MODIFIER

returns void3 paramsbuild 1207

Sets the weapon and melee defense modifiers of player.

Signature

C
void _SET_PLAYER_DEFENSE_MODIFIER(Player player, float weaponDefenseMod, float meleeDefenseMod); // 0x497A6539BB0E8787 b1207

Parameters

#NameType
1playerPlayer
2weaponDefenseModfloat
3meleeDefenseModfloat

Facts

Facts about _SET_PLAYER_DEFENSE_MODIFIER
Name
_SET_PLAYER_DEFENSE_MODIFIER
Hash
0x497A6539BB0E8787
Namespace
Returns
void
Game build
1207

Examples

Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.

Lua
Citizen.InvokeNative(0x497A6539BB0E8787, -- _SET_PLAYER_DEFENSE_MODIFIER
  PlayerId(), -- Player player
  0.0, -- float weaponDefenseMod
  0.0 -- float meleeDefenseMod
)
JavaScript
// Whole JS numbers are sent as integers: pass floats like 1.5 (or n + 0.0000001), never 1.
Citizen.invokeNative("0x497A6539BB0E8787", // _SET_PLAYER_DEFENSE_MODIFIER
  PlayerId(), // Player player
  0.0, // float weaponDefenseMod
  0.0 // float meleeDefenseMod
);
C#
Function.Call((Hash)0x497A6539BB0E8787, // _SET_PLAYER_DEFENSE_MODIFIER
  API.PlayerId(), // Player player
  0.0f, // float weaponDefenseMod
  0.0f // float meleeDefenseMod
);
All PLAYER natives

Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.