#include <amxmodx>
#include <amxmisc>
#include <colorchat>
#include <cstrike>

#define PREFIX "[ZGON]"

#define PLUGIN "[JB]Messages After Dead"
#define VERSION "1.0"
#define AUTHOR "Wielkie Jol"

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_event("DeathMsg", "DeathMsg", "a")
}

public DeathMsg(){
	new nickkid[33], nickvid[33];
	new kid = read_data(1);
	new vid = read_data(2);
	get_user_name(kid, nickkid, 32);
	get_user_name(vid, nickvid, 32);
	if(get_user_team(kid) == 2 && get_user_team(vid) == 1)
		ColorChat(0, GREEN, "%s^x01 --- ^x03 Klawisz %s^x01 zabil^x03 wieznia %s^x01 --- ", PREFIX, nickkid, nickvid);
	else if(vid != kid){
		if(get_user_team(kid) == 1 && get_user_team(vid) == 1)
			ColorChat(0, GREEN, "%s^x01 --- ^x03 Wiezien %s^x01 zabil^x03 wieznia %s^x01 ---  Pozostalo: %d wiezniow", PREFIX, nickkid, nickvid, playersInTeam(CS_TEAM_T)-1);
	}
	else if(get_user_team(kid) == 1 && get_user_team(vid) == 2)
		ColorChat(0, GREEN, "%s^x01 --- ^x03 Wiezien %s^x01 zabil^x03 klawisza %s^x01", PREFIX, nickkid, nickvid);
	else if(kid == vid){
		if(get_user_team(kid) == 1 && get_user_team(vid) == 1)
		ColorChat(0, GREEN, "%s^x01 --- ^x03 Wiezien %s^x01 nie wytrzymal wieziennej presji i popelnil samobojstwo", PREFIX, nickkid);}
	
}

stock playersInTeam( CsTeams: team ){
	new iIle = 0;
	for( new i = 1 ; i < get_maxplayers() ; i++ ){
		if( !is_user_connected( i ) )
			continue;
		if( cs_get_user_team( i ) == team )
			iIle++;
	}
	return iIle;
	
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1250\\ deff0\\ deflang1045{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/
