mirror of
https://github.com/Mr-X-GTA/GTAV-Classes-1.git
synced 2024-12-22 22:47:32 +08:00
feat(CPed): added helper functions (#76)
This commit is contained in:
parent
4022845783
commit
ded244b992
11
ped/CPed.hpp
11
ped/CPed.hpp
@ -12,6 +12,7 @@
|
|||||||
#include "CPedBoneInfo.hpp"
|
#include "CPedBoneInfo.hpp"
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
#pragma pack(push, 1)
|
#pragma pack(push, 1)
|
||||||
|
|
||||||
@ -47,6 +48,16 @@ public:
|
|||||||
float m_hurt_health_threshold; //0x1520
|
float m_hurt_health_threshold; //0x1520
|
||||||
char pad_1524[240]; //0x1524
|
char pad_1524[240]; //0x1524
|
||||||
uint16_t m_cash; //0x1614
|
uint16_t m_cash; //0x1614
|
||||||
|
|
||||||
|
float get_speed() { return std::sqrt(m_velocity.x * m_velocity.x + m_velocity.y * m_velocity.y + m_velocity.z * m_velocity.z); }
|
||||||
|
|
||||||
|
bool can_be_ragdolled() { return m_ped_type & 0x20; }
|
||||||
|
|
||||||
|
uint32_t get_ped_type() { return m_ped_type << 11 >> 25; }
|
||||||
|
|
||||||
|
bool has_seatbelt() { return m_seatbelt & 0x3; }
|
||||||
|
|
||||||
|
void forced_aim(bool toggle) { m_forced_aim ^= (m_forced_aim ^ -(char)toggle) & 0x20; }
|
||||||
}; //Size: 0x1616
|
}; //Size: 0x1616
|
||||||
static_assert(sizeof(CPed) == 0x1616);
|
static_assert(sizeof(CPed) == 0x1616);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user