Add: Show health

This commit is contained in:
2025-03-16 13:38:31 -04:00
parent f5af3d6281
commit d10fcdf15e
5 changed files with 83 additions and 9 deletions

View File

@@ -26,11 +26,14 @@ pub struct PlayerData {
#[serde(rename = "money", default)]
money: i32,
#[serde(rename = "health", default)]
health: u32,
}
impl PlayerData {
pub fn new(pos: Vec3, yaw: f32, player_type: PlayerType, has_bomb: bool, has_awp: bool,
is_scoped: bool, player_name: String, weapon_id: i16) -> PlayerData {
is_scoped: bool, player_name: String, weapon_id: i16, health: u32) -> PlayerData {
PlayerData {
pos,
yaw,
@@ -40,12 +43,13 @@ impl PlayerData {
is_scoped,
player_name,
weapon_id,
money: 0
money: 0,
health
}
}
pub fn new_with_money(pos: Vec3, yaw: f32, player_type: PlayerType, has_bomb: bool, has_awp: bool,
is_scoped: bool, player_name: String, weapon_id: i16, money: i32) -> PlayerData {
is_scoped: bool, player_name: String, weapon_id: i16, money: i32, health: u32) -> PlayerData {
PlayerData {
pos,
yaw,
@@ -55,7 +59,8 @@ impl PlayerData {
is_scoped,
player_name,
weapon_id,
money
money,
health
}
}

View File

@@ -117,8 +117,6 @@ impl DmaCtx {
if money_services_ptr != 0 {
let money_addr: Address = money_services_ptr.into();
money = self.process.read(money_addr + cs2dumper::client::CCSPlayerController_InGameMoneyServices::m_iAccount)?;
log::debug!("Read money value: {} for player", money);
}
let player_name = if player_name_ptr != 0 {

View File

@@ -205,7 +205,8 @@ pub async fn run(radar_data: ArcRwlockRadarData, connector: Connector, pcileech_
local_data.is_scoped,
local_data.player_name,
local_data.weapon_id,
local_data.money
local_data.money,
local_data.health
)
)
);
@@ -246,7 +247,8 @@ pub async fn run(radar_data: ArcRwlockRadarData, connector: Connector, pcileech_
player_data.is_scoped,
player_data.player_name,
player_data.weapon_id,
player_data.money
player_data.money,
player_data.health
)
)
);