#include <sourcemod>
#include <cstrike>
#include <morecolors>

#define MINKILLS 4

new g_iKills[MAXPLAYERS+1] = 0;
new bool:g_bStopkillstreakondeath = true;

public Plugin:myinfo =
{
    name = "Killstreak",
    author = "Jackmaster/Bara",
    description = "asdfmoviez",
    version = "1.0",
    url = "hd-gamer.de"
}

public OnPluginStart()
{
    HookEvent("player_death", OnPlayerDeath);
}

public OnClientPutInServer(client)
{
    g_iKills[client] = 0;
}


public Action:OnPlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    new att = GetClientOfUserId(GetEventInt(event, "attacker"));
    new vic = GetClientOfUserId(GetEventInt(event, "userid"));
    if(IsClientInGame(att) && IsClientInGame(vic))
    {

        g_iKills[att]++;
        if(g_iKills[att] >= MINKILLS)
        {
            CPrintToChatAllEx(att, "{blue}%N {default}hat {red}%i {default}Kills in Folge", att, g_iKills[att]);
        }

        if(g_bStopkillstreakondeath)
        {
            g_iKills[vic] = 0;
        }
    }
    return Plugin_Continue;
} 