Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 27 additions & 24 deletions scripting/gameme.sp
Original file line number Diff line number Diff line change
Expand Up @@ -6098,47 +6098,50 @@ public OnHL2MPTakeDamage(victim, attacker, inflictor, Float:damage, damagetype)
weapon_index = HL2MP_CROSSBOW;
}
}

if (weapon_index == -1) {
weapon_index = get_weapon_index(hl2mp_weapon_list, MAX_HL2MP_WEAPON_COUNT, weapon_str[7]);
}

new hitgroup = ((weapon_index == HL2MP_CROSSBOW) ? hl2mp_players[victim].nextbow_hitgroup : hl2mp_players[victim].next_hitgroup);
if ((hitgroup >= 0) && (hitgroup < 8)) {
switch (hitgroup) {
case HITGROUP_GENERIC:
player_weapons[attacker][weapon_index].wgeneric++;
case HITGROUP_HEAD:
player_weapons[attacker][weapon_index].whead++;
case HITGROUP_CHEST:
player_weapons[attacker][weapon_index].wchest++;
case HITGROUP_STOMACH:
player_weapons[attacker][weapon_index].wstomach++;
case HITGROUP_LEFTARM:
player_weapons[attacker][weapon_index].wleftarm++;
case HITGROUP_RIGHTARM:
player_weapons[attacker][weapon_index].wrightarm++;
case HITGROUP_LEFTLEG:
player_weapons[attacker][weapon_index].wleftleg++;
case HITGROUP_RIGHTLEG:
player_weapons[attacker][weapon_index].wrightleg++;
if (weapon_index > -1) {
new hitgroup = ((weapon_index == HL2MP_CROSSBOW) ? hl2mp_players[victim].nextbow_hitgroup : hl2mp_players[victim].next_hitgroup);

if ((hitgroup >= 0) && (hitgroup < 8)) {
switch (hitgroup) {
case HITGROUP_GENERIC:
player_weapons[attacker][weapon_index].wgeneric++;
case HITGROUP_HEAD:
player_weapons[attacker][weapon_index].whead++;
case HITGROUP_CHEST:
player_weapons[attacker][weapon_index].wchest++;
case HITGROUP_STOMACH:
player_weapons[attacker][weapon_index].wstomach++;
case HITGROUP_LEFTARM:
player_weapons[attacker][weapon_index].wleftarm++;
case HITGROUP_RIGHTARM:
player_weapons[attacker][weapon_index].wrightarm++;
case HITGROUP_LEFTLEG:
player_weapons[attacker][weapon_index].wleftleg++;
case HITGROUP_RIGHTLEG:
player_weapons[attacker][weapon_index].wrightleg++;
}
}
}

new bool: headshot = ((GetClientHealth(victim) <= 0) && (hitgroup == HITGROUP_HEAD));
if (weapon_index > -1) {
player_weapons[attacker][weapon_index].whits++;
player_weapons[attacker][weapon_index].wdamage += RoundToNearest(damage);
new bool: headshot = ((GetClientHealth(victim) <= 0) && (hitgroup == HITGROUP_HEAD));

if (headshot) {
player_weapons[attacker][weapon_index].wheadshots++;
}
}

if (weapon_index == HL2MP_CROSSBOW) {
hl2mp_players[victim].nextbow_hitgroup = 0;
} else {
hl2mp_players[victim].next_hitgroup = 0;
}

}
}

Expand Down