I think the Headshot one should be before the kill. Atleast thats how mine is.
PHP Code:
public eDeath( )
{
new iKiller = read_data(1);
new kill_name[128];
new iVictim = read_data(2);
new vic_name[128];
new iHeadshot = read_data(3);
//Make sure that the killer exists
if( 1 <= iKiller <= get_maxplayers() )
{
//If victim is not killer
if( iVictim != iKiller )
{
//If victim is not a teammate of killer
if( cs_get_user_team( iVictim ) != cs_get_user_team( iKiller ) )
{
get_user_name(iVictim, vic_name, 127);
if(iHeadshot)
{
PlayerXP[iKiller] += get_pcvar_num(XP_Hs);
client_print(iKiller, print_chat, "%s You got bonus XP for killing %s with Headshot", PREFIX, vic_name);
}
else
{
PlayerXP[iKiller] += get_pcvar_num(XP_Kill)
client_print(iKiller, print_chat, "%s You got 20 XP for killing %s", PREFIX, vic_name);
}
//Get the victims name
get_user_name(iVictim, vic_name, 127);
//get the killers name
get_user_name(iKiller, kill_name, 127);
while(PlayerXP[iKiller] >= LEVELS[PlayerLevel[iKiller]])
{
client_print(0, print_chat, "%s You are now on Level %i", PREFIX, PlayerLevel[iKiller]);
PlayerLevel[iKiller] += 1
}
}
}
}
}
PS: Didn't test.