PoolHandle Structure

RAGE Plugin Hook Documentation

[This is preliminary documentation and is subject to change.]

Represents the handle of an item in a pool.

The RAGE engine has a special array type known as a pool.
Pools are widely used throughout RAGE games to store things like Peds, Vehicles, Weapons, Blips, etc.
Pools consist of slots, and each slot has an index ranging from 0 to the pools capacity.
Essentially each slot has a flag that indicates whether the slot is free, and a counter. The counter is purely to avoid duplicate handles in case that same slot is reused immediately after it's freed.
The handle is a composite number (32-bit unsigned integer) where the 24 most significant bits represent the item's index into the pool, and the last 8 bits represent the counter.
Eg. if an item is stored at index 4 and its counter is 7, the handle would be (4 << 8) | 7 = 1031 (0x00000407).
A handle is validated by comparing its counter to the counter in the slot indicated by the index in the handle. If the slot is occupied and the counters match, the handle is valid. These handles are used extensively in the engine's internal scripting system. If a native function takes an entity as parameter, it is by its handle.

Namespace:  Rage
Assembly:  RagePluginHook (in RagePluginHook.dll) Version: 0.0.0.0 (0.56.1131.11510)
Syntax

[SerializableAttribute]
public struct PoolHandle

The PoolHandle type exposes the following members.

Constructors

  NameDescription
Public methodPoolHandle
Initializes a new instance of the PoolHandle class.
Top
Properties

  NameDescription
Public propertyCounter
Gets or sets the counter of this PoolHandle.
Public propertyIndex
Gets or sets the index of this PoolHandle.
Public propertyIsZero
Gets a value indicating whether this PoolHandle is zero.
Public propertyValue
Gets or sets the value of this PoolHandle.
Top
Methods

  NameDescription
Public methodToString (Overrides ValueTypeToString.)
Top
Operators

  NameDescription
Public operatorStatic member(UInt32 to PoolHandle)
Converts the specified UInt32 to a PoolHandle.
Public operatorStatic member(PoolHandle to UInt32)
Converts the specified PoolHandle to a UInt32.
Top
See Also

Reference