
/* AMX Mod script.
*
* (c) Copyright 2002, OLO
* This file is provided as is (no warranties).
*
*/

#include <amxmod>

new mkills[33][2]

public deathmsg_event(){
	new killer = read_data(1)
	new victim = read_data(2)
	if (killer && get_user_team(killer) != get_user_team(victim))	{
		mkills[killer][0]++
		mkills[killer][1] += read_data(3) /* headshot */
		new param[4]
		param[0] = killer
		param[1] = mkills[killer][0]
		set_task(5.0,"check_mkill",0,param,4)
	}
}

public check_mkill(param[])
{
	new id = param[0]
	new ckills = param[1]
	if (ckills == mkills[id][0]){
		if (ckills > 2)	{
			new name[32]
			get_user_name(id,name,32)
			set_hudmessage(0, 100, 200, 0.05, 0.65, 2, 0.02, 6.0, 0.01, 0.1, 2)
			switch(ckills){
				case 3:{
					client_cmd(0,"spk misc/multikill")
					show_hudmessage(0,"MultiKill: %s^nwith %d kills (%d hs)",name,ckills,mkills[id][1])
				}
				case 4:{
					client_cmd(0,"spk misc/ultrakill")
					show_hudmessage(0,"UltraKill: %s^nwith %d kills (%d hs)",name,ckills,mkills[id][1])
				}
				case 5:{
					client_cmd(0,"spk misc/monsterkill")
					show_hudmessage(0,"MonsterKill: %s^nwith %d kills (%d hs)",name,ckills,mkills[id][1])
				}
				case 6:{
					client_cmd(0,"spk misc/killingspree")
					show_hudmessage(0,"KillingSpree: %s^nwith %d kills (%d hs)",name,ckills,mkills[id][1])
				}
			}
		}
		mkills[id][0] = mkills[id][1] = 0
	}
}

public plugin_init() {
	register_plugin("MultiKill","0.6","default")
	register_event("DeathMsg","deathmsg_event","a")
	return PLUGIN_CONTINUE
}

