/*       ______   ___         ___              _____________   ___       ___          ______   _____________
        /      | |   |       |   |            |             | |   |     |   |        /      | |             |
       /       | |   |       |   |            |    _________| |   |     |   |       /       | |____     ____|
      /   /|   | |   |       |   |            |   |           |   |_____|   |      /   /|   |      |   |
     /   /_|   | |   |       |   |            |   |           |             |     /   /_|   |      |   |
    /          | |   |       |   |            |   |           |    _____    |    /          |      |   |
   /   ____    | |   |_____  |   |_____       |   |_________  |   |     |   |   /   ____    |      |   |
  /   /    |   | |         | |         |      |             | |   |     |   |  /   /    |   |      |   |
 /___/     |___| |_________| |_________|      |_____________| |___|     |___| /___/     |___|      |___|


Author: Elliot
Last Edit: 19-7-2008

*/

#include <amxmodx>
#include <amxmisc>
#include <cstrike>


#define PLUGIN "AllChat"
#define VERSION "1.0"
#define AUTHOR "Elliot"


new message[200]
new name[32]
new admin[16]
new team[32]

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_clcmd("say","chat") 
	register_clcmd("say_team","chat") 
}

public chat(id)
{
	read_args(message, 200)
	remove_quotes(message)
	format(message, 200, " %s", message)
	get_user_name(id, name, 31)
	
	if (cs_get_user_team(id)==CS_TEAM_SPECTATOR)
	{
		team = "*SPEC*"
	}
	if (cs_get_user_team(id)==CS_TEAM_T)
	{	
		if (is_user_alive(id))
		{
			team = ""
		}
		else
		{
			team = "*DEAD*"
		}
	}
	if (cs_get_user_team(id)==CS_TEAM_CT)
	{	
		if (is_user_alive(id))
		{
			team = ""
		}
		else
		{
			team = "*DEAD*"
		}
	}
	
	format(message, 200, "%s %s :  %s", team, name, message[1])
	client_print(0, print_chat, "%s", message)
	
	return PLUGIN_HANDLED
}
