Guys why it's not triggering the first ones but its triggering the CheckPoints without catching the headshot or grenade. it should ignore the checkpoints.
PHP Code:
public PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
g_bKm_enabled = GetConVarBool(g_hKm_enabled);
new userId = GetEventInt(event, "userid");
new attackerId = GetEventInt(event, "attacker");
new attacker = GetClientOfUserId(attackerId);
new victim = GetClientOfUserId(userId);
if(IsValidClient(victim) && (g_bKm_enabled)){
new String:weapon[32];
GetEventString(event, "weapon",weapon, sizeof(weapon));
if(StrEqual(weapon,"hegrenade")){
if(IsValidClient(attacker)){
if(g_bClientPrefSounds[attacker]){
EmitSoundToClientAny(attacker, "Km/crossfire/Grenadekill_GR.mp3");
}
if(g_bClientPrefOverlays[attacker]){
SetClientOverlay(attacker, "event_overlay/balticon/badge_grenade");
}
CreateTimer(2.0, DeleteOverlay, attacker);
}
}
if(strncmp(weapon, "knife", 5) == 0){
if(IsValidClient(attacker)){
if(g_bClientPrefSounds[attacker]){
EmitSoundToClientAny(attacker, "Km/crossfire/Grenadekill_GR.mp3");
}
if(g_bClientPrefOverlays[attacker]){
SetClientOverlay(attacker, "event_overlay/balticon/badge_knife");
}
CreateTimer(2.0, DeleteOverlay, attacker);
}
}
if (GetEventBool(event, "headshot") && IsValidClient(victim)){
if(IsValidClient(attacker)){
if(g_bClientPrefSounds[attacker]){
EmitSoundToClientAny(attacker, "Km/crossfire/Headshot_GR.mp3");
}
if(g_bClientPrefOverlays[attacker]){
SetClientOverlay(attacker, "event_overlay/balticon/badge_headshot");
}
CreateTimer(2.0, DeleteOverlay, attacker);
}
}
g_hPoints[victim] = 0;
if(IsValidClient(attacker))
g_hPoints[attacker] += 1;
CheckPoints(attacker);
//PrintToConsole(attacker, " %d",g_hPoints[attacker]);
CreateTimer(2.0, DeleteOverlay, attacker);
}
if (attacker == victim){
if(IsValidClient(victim)){
if(g_bClientPrefSounds[attacker]){
EmitSoundToClientAny(victim, "Km/crossfire/lopas.mp3");
}
if(g_bClientPrefOverlays[attacker]){
SetClientOverlay(victim, "event_overlay/balticon/lopas");
}
CreateTimer(2.0, DeleteOverlay, victim);
g_hPoints[victim] = 0;
g_hPoints[attacker] = 0;
}
}
}
}