bool Commands::playerKills(Creature* creature, const std::string& cmd, const std::string& param)
{
Player* player = creature->getPlayer();
if(player)
{
int32_t fragTime = g_config.getNumber(ConfigManager::FRAG_TIME);
if(player->redSkullTicks && fragTime > 0)
{
int32_t frags = (player->redSkullTicks / fragTime) + 1;
int32_t remainingTime = player->redSkullTicks - (fragTime * (frags - 1));
int32_t hours = ((remainingTime / 1000) / 60) / 60;
int32_t minutes = ((remainingTime / 1000) / 60) - (hours * 60);
char buffer[175];
sprintf(buffer, "You have %d unjustified frag%s. The amount of unjustified frags will decrease after: %s.", frags, (frags > 1 ? "s" : ""), formatTime(hours, minutes).c_str());
player->sendTextMessage(MSG_STATUS_CONSOLE_BLUE, buffer);
}
else
player->sendTextMessage(MSG_STATUS_CONSOLE_BLUE, "You do not have any unjustified frag.");
}
return false;
}