Skip to content

Player ​

Group player · 13 exports · from forks/gamexueren/scripthook.h (framework 1.0-beta7-wildm1, SH_API_VERSION 2)

The local player, via the engine's own component.

ExportSummary
ShGetPlayerThe local player.
ShEntityVtableThe live entity vtable.
ShGetPlayerPositionThe soldier's own position, from its matrix.
ShGetCameraEyePositionWhere the player global says the view sits, about 1.9m behind and 1.6m above the body in third person.
ShTeleportPlayerIn a vehicle it carries the car and the camera, and that is verified cross map too.
ShTeleportPlayerHopsdelayMs is a real pause per hop.
ShIsInVehicleTrue while riding a vehicle, read from the entity link in the parent chain.
ShIsSwimmingTrue while the local player is actively swimming.
ShSetSuperAccuracyPin the player's spread to zero while enabled.
ShGetSuperAccuracySee ShSetSuperAccuracy.
ShSetSuperAccuracyActiveSee ShSetSuperAccuracy.
ShWalkToRootWalk an entity's parent chain to its root.
ShInvalidateDrop the cached player, so the next call re-resolves.

ShGetPlayer ​

c
SH_API int  ShGetPlayer(ShPlayer *out);

The local player. In a vehicle the root re-parents to the vehicle; the entity stays the soldier.

Never scans and never blocks: if the framework has not resolved the player yet (first spawn after a load, a moment after a vehicle change re-parents it) this answers 0 and the caller tries again next tick. The recovery walk it used to fall into reads every committed page in the process, which is not something a plugin polling at 60Hz should be able to ask for. [api] player_scan=1 in scripthook.ini restores the old behaviour; the framework's own recovery paths still scan.

scripthook.h, line 613

ShEntityVtable ​

c
SH_API uint64_t ShEntityVtable(void);

The live entity vtable. A game update moves it, and a stale value makes every entity test silently answer no - so the framework learns it from the player entity and this is where the rest of the code asks. Before it is known the pinned constant is answered.

scripthook.h, line 619

ShGetPlayerPosition ​

c
SH_API int  ShGetPlayerPosition(ShVec3 *out);

The soldier's own position, from its matrix. Use this for anything placed in the world.

scripthook.h, line 622

ShGetCameraEyePosition ​

c
SH_API int  ShGetCameraEyePosition(ShVec3 *out);

Where the player global says the view sits, about 1.9m behind and 1.6m above the body in third person.

scripthook.h, line 625

ShTeleportPlayer ​

c
SH_API int  ShTeleportPlayer(const ShVec3 *pos,
                             const ShVec3 *orient);

In a vehicle it carries the car and the camera, and that is verified cross map too.

scripthook.h, line 632

ShTeleportPlayerHops ​

c
SH_API int  ShTeleportPlayerHops(const ShVec3 *pos,
                                 const ShVec3 *orient,
                                 float hopMetres, int delayMs);

delayMs is a real pause per hop. 300 is the value proven over long routes, 0 has crashed the game.

scripthook.h, line 641

ShIsInVehicle ​

c
SH_API int  ShIsInVehicle(void);

True while riding a vehicle, read from the entity link in the parent chain. Verified both ways.

scripthook.h, line 648

ShIsSwimming ​

c
SH_API int  ShIsSwimming(void);

True while the local player is actively swimming. Read from the locomotion component's state byte, held across its brief transitions; see ShGetOccupiedVehicle for the vehicle side.

scripthook.h, line 652

ShSetSuperAccuracy ​

c
SH_API int      ShSetSuperAccuracy(int enabled);

Pin the player's spread to zero while enabled. Installs three verified mid-function hooks; 1 once they are in. The Active call pauses the effect without uninstalling, so a mode blacklist can hand the spread back frame by frame.

scripthook.h, line 659

ShGetSuperAccuracy ​

c
SH_API int      ShGetSuperAccuracy(void);

Documented together with ShSetSuperAccuracy just above.

scripthook.h, line 660

ShSetSuperAccuracyActive ​

c
SH_API void     ShSetSuperAccuracyActive(int active);

Documented together with ShSetSuperAccuracy just above.

scripthook.h, line 661

ShWalkToRoot ​

c
SH_API int  ShWalkToRoot(uint64_t entity, uint64_t *outRoot);

Walk an entity's parent chain to its root.

scripthook.h, line 1092

ShInvalidate ​

c
SH_API void ShInvalidate(void);

Drop the cached player, so the next call re-resolves.

scripthook.h, line 1094

WildM is an independent community project. It is not affiliated with or endorsed by Ubisoft. Ghost Recon Wildlands is a trademark of Ubisoft Entertainment.