register_callback('player_hurt', function() {
var userid = entity.get_player_for_user_id(current_event.get_int("userid"))
var attacker = entity.get_player_for_user_id(current_event.get_int("attacker"))
var userid_info = entity.get_player_info(userid);
var attacker_info = entity.get_player_info(attacker);
var hitgroup = current_event.get_int("hitgroup");
if(attacker == entity.get_local_player() && userid != entity.get_local_player())
utils.play_sound("C:\\hit.wav")
});
function hs() {
var attacker = current_event.get_int("attacker");
var enemy = current_event.get_int("userid");
var attacker_index = entity.get_player_for_user_id(attacker);
var enemy_index = entity.get_player_for_user_id(enemy);
var me = entity.get_local_player();
var enemies = entity.get_enemies();
var attacker_name = entity.get_player_info(attacker_index).name;
var enemy_name = entity.get_player_info(enemy_index).name;
if(attacker_index == me) {
for(i in enemies) {
utils.play_sound("C:\\hit.wav")
}
}
}
register_callback("player_death", hs);