GRW ScriptHook 0.11.0
Plugin API for Ghost Recon Wildlands
Loading...
Searching...
No Matches
Stats and ammo

Health, resources, skill points, stealth and ammo. More...

Macros

#define SH_RES_FOOD   0
 The four crafting resources, by name.
#define SH_RES_GASOLINE   1
#define SH_RES_MEDICINE   2
#define SH_RES_COMMS   3

Functions

SH_API int ShGetHealthPlayer (uint32_t *cur, uint32_t *max)
 Health, local player.
SH_API int ShSetHealthPlayer (uint32_t value)
SH_API int ShSetGodModePlayer (int on)
SH_API int ShDamagePlayer (uint32_t amount)
 Damage through the engine's own path, so death runs its real sequence.
SH_API int ShKillPlayer (void)
SH_API int ShSetCannotDiePlayer (int on)
 Floors at the downed state instead of dying.
SH_API void ShInvalidateHealth (void)
SH_API int ShGetHealthEntity (uint64_t entity, uint32_t *cur, uint32_t *max)
 Entity targeted variants.
SH_API int ShSetHealthEntity (uint64_t entity, uint32_t value)
SH_API int ShSetGodModeEntity (uint64_t entity, int on)
SH_API int ShStatRead (uint64_t stat, uint32_t *out)
 Protected ints, the general stat storage: four bit planes and an XOR key.
SH_API int ShStatWrite (uint64_t stat, uint32_t value)
SH_API int ShGetResource (int which, uint32_t *out)
SH_API int ShSetResource (int which, uint32_t value)
SH_API int ShSetAllResources (uint32_t value)
SH_API int ShGetSkillPoints (uint32_t *out)
 Skill points, a plain int rather than a protected one.
SH_API int ShSetSkillPoints (uint32_t value)
SH_API int ShSetVisibility (float factor)
 Visibility to enemies.
SH_API int ShGetVisibility (float *out)
SH_API int ShGetAmmo (int slot, uint32_t *out)
 Ammo by weapon slot: 0 primary, 1 second, 2 sidearm.
SH_API int ShSetAmmo (int slot, uint32_t value)

Detailed Description

Health, resources, skill points, stealth and ammo.

Macro Definition Documentation

◆ SH_RES_FOOD

#define SH_RES_FOOD   0

The four crafting resources, by name.

◆ SH_RES_GASOLINE

#define SH_RES_GASOLINE   1

◆ SH_RES_MEDICINE

#define SH_RES_MEDICINE   2

◆ SH_RES_COMMS

#define SH_RES_COMMS   3

Function Documentation

◆ ShGetHealthPlayer()

SH_API int ShGetHealthPlayer ( uint32_t * cur,
uint32_t * max )

Health, local player.

The API owns the reference: it resolves and caches internally, plugins never hold one.

◆ ShSetHealthPlayer()

SH_API int ShSetHealthPlayer ( uint32_t value)

◆ ShSetGodModePlayer()

SH_API int ShSetGodModePlayer ( int on)

◆ ShDamagePlayer()

SH_API int ShDamagePlayer ( uint32_t amount)

Damage through the engine's own path, so death runs its real sequence.

Queued onto the game thread.

◆ ShKillPlayer()

SH_API int ShKillPlayer ( void )

◆ ShSetCannotDiePlayer()

SH_API int ShSetCannotDiePlayer ( int on)

Floors at the downed state instead of dying.

◆ ShInvalidateHealth()

SH_API void ShInvalidateHealth ( void )

◆ ShGetHealthEntity()

SH_API int ShGetHealthEntity ( uint64_t entity,
uint32_t * cur,
uint32_t * max )

Entity targeted variants.

The entity comes from the enumerator, never from a raw pointer a plugin invented.

◆ ShSetHealthEntity()

SH_API int ShSetHealthEntity ( uint64_t entity,
uint32_t value )

◆ ShSetGodModeEntity()

SH_API int ShSetGodModeEntity ( uint64_t entity,
int on )

◆ ShStatRead()

SH_API int ShStatRead ( uint64_t stat,
uint32_t * out )

Protected ints, the general stat storage: four bit planes and an XOR key.

Health, resources, skill points, XP.

◆ ShStatWrite()

SH_API int ShStatWrite ( uint64_t stat,
uint32_t value )

◆ ShGetResource()

SH_API int ShGetResource ( int which,
uint32_t * out )

◆ ShSetResource()

SH_API int ShSetResource ( int which,
uint32_t value )

◆ ShSetAllResources()

SH_API int ShSetAllResources ( uint32_t value)

◆ ShGetSkillPoints()

SH_API int ShGetSkillPoints ( uint32_t * out)

Skill points, a plain int rather than a protected one.

◆ ShSetSkillPoints()

SH_API int ShSetSkillPoints ( uint32_t value)

◆ ShSetVisibility()

SH_API int ShSetVisibility ( float factor)

Visibility to enemies.

1 normal, 0 invisible, 0.5 halves the detection range, above 1 is easier to spot.

◆ ShGetVisibility()

SH_API int ShGetVisibility ( float * out)

◆ ShGetAmmo()

SH_API int ShGetAmmo ( int slot,
uint32_t * out )

Ammo by weapon slot: 0 primary, 1 second, 2 sidearm.

◆ ShSetAmmo()

SH_API int ShSetAmmo ( int slot,
uint32_t value )