Just another way
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>
#define m_LastHitGroup 75
new KillCount[33]
public plugin_init()
{
RegisterHam(Ham_Killed, "player", "death");
register_logevent("ResetKills",2,"1=Round_Start")
}
public client_disconnect(id)
KillCount[id] = 0
public ResetKills()
{
new players[32] , inum
get_players(players, inum)
for(new a = 0; a < inum; ++a)
KillCount[a] = 0
}
public death(iVictim, iInflictor, iAttacker, iShouldGib)
{
new HitGroup = get_pdata_int(iVictim, m_LastHitGroup);
if(iAttacker != iVictim && cs_get_user_team(iVictim) != cs_get_user_team(iAttacker))
{
KillCount[iAttacker]++
if(HitGroup == HIT_HEAD)
{
//Was a Headshot
}
if(KillCount[iAttacker] == 3)
{
//if he has killed 3 this round execute a function
SomeFunction(iAttacker)
}
}
return HAM_IGNORED;
}
public SomeFunction(id)
{
//your code here
client_print(id, print_chat, "This is your third kill this round!")
}
you can check head shots also in death message by using read_data(3) and doing a check like this
PHP Code:
new HeadShot = read_data(3)
if(HeadShot)
{
//Was a headshot
}
Also i didnt edit his code just changed it over to ham so i didn't test the way it works.