altmp/altv-js-module-v2

JSON.stringify doesn't get all entity properties

Closed this issue · 1 comments

Yiin commented
const jim = alt.Ped.create({
  model: 's_m_y_cop_01',
  pos: new alt.Vector3({ x: 4476.591, y: -4493.673, z: 4.1902 }),
  heading: 0,
});

alt.log(JSON.stringify(jim));
 {"streamSyncedMeta":{},"syncedMeta":{},"meta":{},"type":2,"id":2}

Missing:

  • Base object
    • valid
  • WorldObject
    • dimension
    • pos
  • Entity
    • model
    • netOwner
    • rot
    • visible
    • streamed
    • frozen
    • collision
    • timestamp
  • Ped
    • health
    • maxHealth
    • armour
    • currentWeapon

Stringifying entities is something that will never work correctly due to the complexity of the classes. It shouldn't ever matter.