
public motd_help(id)
{
	static motd_header[64];
	new motd_body[2048],len;

	len += formatex(motd_body[len],2047-len,html_header);
	
	formatex(motd_header,63,"%L",id,"L_MOTD_TITLE_HELP",PLUGIN_NAME);
	
	len += formatex(motd_body[len],2047-len,"%L",id,"L_MOTD_HELP");

	len += formatex(motd_body[len],2047-len,html_footer);
	
	show_motd(id,motd_body,motd_header);
	
	return PLUGIN_HANDLED;
}

public motd_commands(id)
{
	static motd_header[64];
	new motd_body[2048],len;

	len += formatex(motd_body[len],2047-len,html_header);
	
	formatex(motd_header,63,"%L",id,"L_MOTD_TITLE_COMMANDS",PLUGIN_NAME);
	
	len += formatex(motd_body[len],2047-len,"%L",id,"L_MOTD_COMMANDS");

	len += formatex(motd_body[len],2047-len,html_footer);
	
	show_motd(id,motd_body,motd_header);
	
	return PLUGIN_HANDLED;
}

public motd_about(id)
{
	static motd_header[64];
	new motd_body[2048],len;

	len += formatex(motd_body[len],2047-len,html_header);
	
	formatex(motd_header,63,"%L",id,"L_MOTD_TITLE_ABOUT",PLUGIN_NAME);
	
	len += formatex(motd_body[len],2047-len,"%L",id,"L_MOTD_ABOUT",PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_AUTHOR);

	len += formatex(motd_body[len],2047-len,html_footer);
	
	show_motd(id,motd_body,motd_header);
	
	return PLUGIN_HANDLED;
}

public motd_players(id)
{
	static num_ct,num_t,num_s,motd_header[64];
	new motd_body[1024],len,name[128],players_ct[MAXPLAYERS],players_t[MAXPLAYERS],players_s[MAXPLAYERS];

	len += formatex(motd_body[len],1023-len,html_header);
	
	formatex(motd_header,63,"%L",id,"L_MOTD_TITLE_PLAYERLIST",PLUGIN_NAME);
	
	get_players(players_ct,num_ct,"ceh","CT");
	get_players(players_t,num_t,"ceh","TERRORIST");
	get_players(players_s,num_s,"ceh","SPECTATOR");
	
	len += formatex(motd_body[len],1023-len,"<br /><br /><h2 class='ct'>Counter-Terrorist:</h2><ul>");
	
	new deathgod[]="<span class='deathgod'><li>";
	new hollow[]="<span class='hollow'><li>";
	
	for (new i; i < num_ct; ++i)
	{
		new v=players_ct[i];
		
		if(is_user_connected(v) && g_player_class[v] > 0)
		{
			get_user_name(v,name,127);
			
			replace(name,127,"<","&lt;");
			replace(name,127,">","&gt;");
			
			if(g_player_class[v] == 1) len += formatex(motd_body[len],1023-len,deathgod);
			else len += formatex(motd_body[len],1023-len,hollow);
			
			len += formatex(motd_body[len],1023-len,"%s, %s level %d</span></li>",name,g_bleach_classes[g_player_class[v]],g_player_level[v]);
		}
	}
	
	if(num_ct < 1) len += formatex(motd_body[len],1023-len,"%L",id,"L_MOTD_NO_PLAYERS");
	else len += formatex(motd_body[len],1023-len,"</ul>");
	
	len += formatex(motd_body[len],1023-len,"<br /><br /><h2 class='ts'>Terrorist:</h2><ul>");
	
	for (new i; i < num_t; ++i)
	{
		new v=players_t[i];
		
		if(is_user_connected(v) && g_player_class[v] > 0)
		{
			get_user_name(v,name,127);
			
			replace(name,127,"<","&lt;");
			replace(name,127,">","&gt;");
			
			if(g_player_class[v] == 1) len += formatex(motd_body[len],1023-len,deathgod);
			else len += formatex(motd_body[len],1023-len,hollow);
			
			len += formatex(motd_body[len],1023-len,"%s, %s level %d</span></li>",name,g_bleach_classes[g_player_class[v]],g_player_level[v]);
		}
	}
	
	if(num_t < 1) len += formatex(motd_body[len],1023-len,"%L",id,"L_MOTD_NO_PLAYERS");
	else len += formatex(motd_body[len],1023-len,"</ul>");
	
	len += formatex(motd_body[len],1023-len,"<br /><br /><h2 class='sp'>Spectator:</h2><ul>");
	
	for (new i; i < num_s; ++i)
	{
		new v=players_s[i];
		
		if(is_user_connected(v) && g_player_class[v] > 0)
		{
			get_user_name(v,name,127);
			
			replace(name,127,"<","&lt;");
			replace(name,127,">","&gt;");
			
			if(g_player_class[v] == 1) len += formatex(motd_body[len],1023-len,deathgod);
			else len += formatex(motd_body[len],1023-len,hollow);
			
			len += formatex(motd_body[len],1023-len,"%s, %s level %d</span></li>",name,g_bleach_classes[g_player_class[v]],g_player_level[v]);
		}
	}
	
	if(num_s < 1) len += formatex(motd_body[len],1023-len,"%L",id,"L_MOTD_NO_PLAYERS");
	else len += formatex(motd_body[len],1023-len,"</ul>");
	
	len += formatex(motd_body[len],1023-len,html_footer);
	
	show_motd(id,motd_body,motd_header);
	
	return PLUGIN_HANDLED;
}

public motd_skills(id)
{
	if(g_player_class[id]==CLASS_NONE) return PLUGIN_HANDLED;
	
	static motd_header[64];
	new motd_body[2048],len;
	
	formatex(motd_header,63,"%L",id,"L_MOTD_TITLE_SKILLS",PLUGIN_NAME);

	len += formatex(motd_body[len],2047-len,html_header);
	
	len += formatex(motd_body[len],1023-len,"%L",id,"L_MOTD_SKILLS");
	
	if(g_player_class[id]==CLASS_DEATHGOD)
	{
		len += formatex(motd_body[len],1023-len,"%L",id,"L_MOTD_SKILLS_DEATHGOD");
	}
	else if(g_player_class[id]==CLASS_HOLLOW)
	{
		len += formatex(motd_body[len],1023-len,"%L",id,"L_MOTD_SKILLS_HOLLOW");
	}
	
	len += formatex(motd_body[len],1023-len,html_footer);
	
	show_motd(id,motd_body,motd_header);
	
	return PLUGIN_HANDLED;
}

public motd_attributes(id)
{
	static motd_header[64];
	new motd_body[2048],len;

	len += formatex(motd_body[len],2047-len,html_header);
	
	formatex(motd_header,63,"%L",id,"L_MOTD_TITLE_ATTRIBUTES",PLUGIN_NAME);
	
	len += formatex(motd_body[len],2047-len,"%L",id,"L_MOTD_ATTRIBUTES");

	len += formatex(motd_body[len],2047-len,html_footer);
	
	show_motd(id,motd_body,motd_header);
	
	return PLUGIN_HANDLED;
}

public motd_items(id)
{
	static motd_header[64];
	new motd_body[2048],len;

	len += formatex(motd_body[len],2047-len,html_header);
	
	formatex(motd_header,63,"%L",id,"L_MOTD_TITLE_ITEMS",PLUGIN_NAME);
	
	len += formatex(motd_body[len],2047-len,"%L",id,"L_MOTD_ITEMS");

	len += formatex(motd_body[len],2047-len,html_footer);
	
	show_motd(id,motd_body,motd_header);
	
	return PLUGIN_HANDLED;
}

public motd_character(id)
{
	static motd_header[64],CsArmorType:armor_type,gravity;
	new motd_body[2048],len;

	len += formatex(motd_body[len],2047-len,html_header);
	
	formatex(motd_header,63,"%L",id,"L_MOTD_TITLE_CHARACTER",PLUGIN_NAME);
	
	gravity=floatround(get_cvar_num("sv_gravity")*get_user_gravity(id));
	
	len += formatex(motd_body[len],2047-len,"%L",id,"L_MOTD_CHARACTER_START",
	g_bleach_classes[g_player_class[id]],
	g_player_experience[id],
	g_player_next_level[g_player_level[id]],
	g_player_level[id],
	g_player_attributepoints[id],g_player_skillpoints[id],
	g_player_athletic[id],g_player_acrobatic[id],g_player_endurance[id],
	gravity,get_user_maxspeed(id),
	get_user_health(id),cs_get_user_armor(id,armor_type),g_player_spirit[id],
	g_player_max_health[id],g_player_max_armour[id],g_player_max_spirit[id],
	g_item_names[g_player_item[id]]);
	
	if(g_player_class[id] == 1)
	{
		len += formatex(motd_body[len],2047-len,"%L",id,"L_MOTD_CHARACTER_DG",
		g_skill[id][P_SKILL_1],
		g_skill[id][P_SKILL_2],
		g_skill[id][P_SKILL_3],
		g_skill[id][P_SKILL_4],
		g_skill[id][P_SKILL_5],
		g_skill[id][P_SKILL_6]);
	}
	else if(g_player_class[id] ==2)
	{
		len += formatex(motd_body[len],2047-len,"%L",id,"L_MOTD_CHARACTER_HW",
		g_skill[id][P_SKILL_1],
		g_skill[id][P_SKILL_2],
		g_skill[id][P_SKILL_3],
		g_skill[id][P_SKILL_4],
		g_skill[id][P_SKILL_5],
		g_skill[id][P_SKILL_6]);
	}
	
	len += formatex(motd_body[len],2047-len,"%L",id,"L_MOTD_CHARACTER_END");
	len += formatex(motd_body[len],2047-len,html_footer);
	
	show_motd(id,motd_body,motd_header);
	
	return PLUGIN_HANDLED;
}
