Add: Show health
This commit is contained in:
13
src/comms.rs
13
src/comms.rs
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user