From 87d5637c09dca61a650fe81d83ef328943176503 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Thu, 7 Nov 2013 20:08:05 +0000 Subject: Save/load player reputation, count player NPC and PVP kills. --- src/core/player.cc | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'src/core/player.cc') diff --git a/src/core/player.cc b/src/core/player.cc index e7fb024..eb5f08e 100644 --- a/src/core/player.cc +++ b/src/core/player.cc @@ -49,21 +49,24 @@ void Player::clear() player_admin_level = 0; player_reputation.clear(); + + player_npckills = 0; + player_pvpkills = 0; } void Player::print() const { con_print << "id: ^B" << id() << "^N name: ^B" << name() << "^N" << std::endl; - con_print << " color ^B" << color() << std::endl; - con_print << " ping ^B" << ping() << std::endl; - con_print << " credits ^B" << credits() << std::endl; - con_print << " level ^B" << level() << std::endl; - if (zone()) { con_print << " zone ^B" << zone()->name() << std::endl; } - + con_print << " color ^B" << color() << std::endl; + con_print << " ping ^B" << ping() << std::endl; + con_print << " credits ^B" << credits() << std::endl; + con_print << " level ^B" << level() << std::endl; + con_print << " npc kills ^B" << npckills() << std::endl; + con_print << " pvp kills ^B" << pvpkills() << std::endl; } void Player::message(Message::Channel channel, const std::string text) @@ -142,7 +145,17 @@ void Player::set_admin_level(const int admin_level) { player_admin_level = admin_level; } + +void Player::set_npckills(const long kills) +{ + player_npckills = kills; +} +void Player::set_pvpkills(const long kills) +{ + player_pvpkills = kills; +} + void Player::update_info() { Cvar *cl_name = Cvar::find("cl_name"); -- cgit v1.2.3