Guest User

Untitled

a guest
Sep 27th, 2025
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.84 KB | None | 0 0
  1. // 0x4642182A298187D0
  2. // namespace PED
  3.  
  4. // Queries/refreshes the current “carry” action for a ped and (optionally) returns involved entities.
  5. // Return: status (0..3), see Status enum below.
  6. NATIVE_DECL int _REFRESH_CARRY_STATE_FOR_PED(Ped ped, int carryType, Any* outEnts, int outEntsCount, int filterFlags);
  7. // Notes:
  8. // - outEnts must point to a buffer for 4 ints and you should pass outEntsCount = 4.
  9. // - Only outEnts[0] and outEnts[2] are used:
  10. //     outEnts[0] = carried entity GUID (or 0)
  11. //     outEnts[2] = “taken-from” entity GUID (or 0)
  12. //   outEnts[1] and outEnts[3] are currently unused/reserved.
  13. //
  14. // Provenance (IDA):
  15. // - The wrapper enforces `8 * outEntsCount == 0x20` → outEntsCount must be 4.
  16. // - The native writes GUIDs into outEnts[0] and outEnts[2] and returns a status from sub_141CF21D4.
  17. // - If (filterFlags & 4) and a specific extension is present on the candidate entity, both GUIDs are zeroed and 0 is returned.
  18.  
  19. //
  20. // Status (return value)
  21. //
  22. enum : int {
  23.     CARRY_STATUS_INVALID      = 0, // no relevant action or filtered out
  24.     CARRY_STATUS_STARTING     = 1,
  25.     CARRY_STATUS_PROGRESSING  = 2,
  26.     CARRY_STATUS_FINISHING    = 3,
  27. };
  28.  
  29. //
  30. // Carry types (observed in scripts)
  31. //
  32. enum : int {
  33.     CARRY_ANY                 = -1,
  34.     CARRY_GENERIC             = 0,  // generic aggregator (data @ +0xD10)
  35.     CARRY_TYPE_1              = 1,
  36.     CARRY_TYPE_2              = 2,
  37.     CARRY_SPECIAL_3           = 3,  // distinct pipeline (@ +0xA30)
  38.     CARRY_FROM_GROUND         = 4,  // manager slot 4 (@ +0xB8)
  39.     CARRY_FROM_MOUNT          = 5,  // manager slot 5; returns “taken-from” (either +0xE0 or +0xE8)
  40.     PUT_DOWN_TO_GROUND        = 6,  // (@ +0xB8)
  41.     PUT_DOWN_TO_MOUNT         = 7,  // (@ +0x900) + taken-from (@ +0x928)
  42.     CARRY_TYPE_8              = 8,
  43.     CARRY_SPECIAL_9           = 9,  // (@ +0xC0)
  44.     CARRY_TYPE_10             = 10,
  45. };
  46.  
  47. //
  48. // Filters / flags (what the native receives)
  49. // NOTE: scripts commonly pass 0, 1, or 2. Internally this is treated as a bitmask;
  50. //       bit 2 (value 4) toggles an extra extension check that can zero the outputs.
  51. //
  52. enum : int {
  53.     CARRY_FILTER_ENTITIES_ONLY            = 0, // normal: returns carried and taken-from entities
  54.     CARRY_FILTER_NOTHING                  = 1, // stricter filtering (still returns status)
  55.     CARRY_FILTER_ENTITIES_AND_SOURCE      = 2, // explicit request for both entities
  56.     CARRY_FILTER_INTERNAL_EXT_CHECK       = 4, // (observed) if set and a certain extension is present, outputs become 0
  57. };
  58.  
  59. // Minimal usage pattern (matches script usage):
  60. // int ents[4] = {};
  61. // int status = PED::_REFRESH_CARRY_STATE_FOR_PED(ped, CARRY_FROM_MOUNT, ents, 4, CARRY_FILTER_ENTITIES_ONLY);
  62. // if (status != CARRY_STATUS_INVALID) {
  63. //     Entity carried = ents[0];
  64. //     Entity takenFrom = ents[2];
  65. //     ...
  66. // }
  67.  
Advertisement
Add Comment
Please, Sign In to add comment