Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 0x4642182A298187D0
- // namespace PED
- // Queries/refreshes the current “carry” action for a ped and (optionally) returns involved entities.
- // Return: status (0..3), see Status enum below.
- NATIVE_DECL int _REFRESH_CARRY_STATE_FOR_PED(Ped ped, int carryType, Any* outEnts, int outEntsCount, int filterFlags);
- // Notes:
- // - outEnts must point to a buffer for 4 ints and you should pass outEntsCount = 4.
- // - Only outEnts[0] and outEnts[2] are used:
- // outEnts[0] = carried entity GUID (or 0)
- // outEnts[2] = “taken-from” entity GUID (or 0)
- // outEnts[1] and outEnts[3] are currently unused/reserved.
- //
- // Provenance (IDA):
- // - The wrapper enforces `8 * outEntsCount == 0x20` → outEntsCount must be 4.
- // - The native writes GUIDs into outEnts[0] and outEnts[2] and returns a status from sub_141CF21D4.
- // - If (filterFlags & 4) and a specific extension is present on the candidate entity, both GUIDs are zeroed and 0 is returned.
- //
- // Status (return value)
- //
- enum : int {
- CARRY_STATUS_INVALID = 0, // no relevant action or filtered out
- CARRY_STATUS_STARTING = 1,
- CARRY_STATUS_PROGRESSING = 2,
- CARRY_STATUS_FINISHING = 3,
- };
- //
- // Carry types (observed in scripts)
- //
- enum : int {
- CARRY_ANY = -1,
- CARRY_GENERIC = 0, // generic aggregator (data @ +0xD10)
- CARRY_TYPE_1 = 1,
- CARRY_TYPE_2 = 2,
- CARRY_SPECIAL_3 = 3, // distinct pipeline (@ +0xA30)
- CARRY_FROM_GROUND = 4, // manager slot 4 (@ +0xB8)
- CARRY_FROM_MOUNT = 5, // manager slot 5; returns “taken-from” (either +0xE0 or +0xE8)
- PUT_DOWN_TO_GROUND = 6, // (@ +0xB8)
- PUT_DOWN_TO_MOUNT = 7, // (@ +0x900) + taken-from (@ +0x928)
- CARRY_TYPE_8 = 8,
- CARRY_SPECIAL_9 = 9, // (@ +0xC0)
- CARRY_TYPE_10 = 10,
- };
- //
- // Filters / flags (what the native receives)
- // NOTE: scripts commonly pass 0, 1, or 2. Internally this is treated as a bitmask;
- // bit 2 (value 4) toggles an extra extension check that can zero the outputs.
- //
- enum : int {
- CARRY_FILTER_ENTITIES_ONLY = 0, // normal: returns carried and taken-from entities
- CARRY_FILTER_NOTHING = 1, // stricter filtering (still returns status)
- CARRY_FILTER_ENTITIES_AND_SOURCE = 2, // explicit request for both entities
- CARRY_FILTER_INTERNAL_EXT_CHECK = 4, // (observed) if set and a certain extension is present, outputs become 0
- };
- // Minimal usage pattern (matches script usage):
- // int ents[4] = {};
- // int status = PED::_REFRESH_CARRY_STATE_FOR_PED(ped, CARRY_FROM_MOUNT, ents, 4, CARRY_FILTER_ENTITIES_ONLY);
- // if (status != CARRY_STATUS_INVALID) {
- // Entity carried = ents[0];
- // Entity takenFrom = ents[2];
- // ...
- // }
Advertisement
Add Comment
Please, Sign In to add comment