• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Frags count

Fare

Advanced OT User
Joined
Apr 3, 2008
Messages
2,387
Reaction score
151
Location
Ukraine
Can i have code for TFS for counting frags, for example:
You see yourself.You is a knight.You have 5 frags.
)
 
Code:
std::string Player::getDescription(int32_t lookDistance) const
{
	std::stringstream s;
	std::string str;
	if(lookDistance == -1)
	{
		s << "yourself.";
		if(accessLevel != 0)
			s << " You are " << groupName << ".";
		else if(vocation_id != 0)
			s << " You are " << vocation->getVocDescription() << ".";
		else
			s << " You have no vocation.";
		int32_t fragTime = g_config.getNumber(ConfigManager::FRAG_TIME);
	int32_t frags = (player->redSkullTicks / fragTime) + 1;

(frags > 1 ? s << " You have " << frags << " unjustified frag." :
  s << " You have " << frags << " unjustified frags.");
	}
	else
	{
		s << name;
		if(accessLevel == 0)
			s << " (Level " << level << ")";
		s << ".";

		if(sex == PLAYERSEX_FEMALE)
			s << " She";
		else
			s << " He";

		if(accessLevel >= 3)
			s << " is " << groupName << ".";
		else if(vocation_id != 0){
			s << " is " << vocation->getVocDescription();
			if(accessLevel != 0)
                  s << " (" << groupName << ").";
            else
                s << ".";
                }
		else
			s << " has no vocation.";
	}

	if(guildId)
	{
		if(lookDistance == -1)
			s << " You are ";
		else
		{
			if(sex == PLAYERSEX_FEMALE)
				s << " She is ";
			else
				s << " He is ";
		}
		if(guildRank.length())
			s << guildRank;
		else
			s << "a member";
		s << " of the " << guildName;
		if(guildNick.length())
			s << " (" << guildNick << ")";
		s << ".";
	}
	str = s.str();
	return str;
}

My first code, hihi :P Dunno if will work properly.
 
ohh, thanks for these fast reply, but I look in code and think, you kinda miss undesrand me, I want system like pvp enfo, all maked frags are counted, etc )
 
Back
Top