mr.master: since after v1.134 ti_on_weapon_attack fires on the server as well, so the first event is not necessary any more; I'd just make a script that sends the play sound message to clients from the server and call it from the attack trigger, like this:
All the (neq, ":player_no", 0) and (neg|is_between, ":agent", 0, 200) are confusing and unnecessary: just use player_is_active or agent_is_active, as these check to see if any given id is currently valid.
Code:
("agent_play_sound",
[(try_begin),
(multiplayer_is_server),
(store_script_param, ":agent_id", 1),
(store_script_param, ":sound_id", 2),
(get_max_players, ":max_players"),
(try_for_range, ":player_id", 0, ":max_players"),
(player_is_active, ":player_id"),
(multiplayer_send_2_int_to_player, ":player_id", multiplayer_event_agent_play_sound, ":agent_id", ":sound_id"),
(try_end),
(try_end),
]),
...
(else_try),
(eq, ":event_type", multiplayer_event_agent_play_sound),
(store_script_param, ":agent_id", 3),
(store_script_param, ":sound_id", 4),
(try_begin),
(agent_is_active, ":agent_id"),
(agent_is_alive, ":agent_id"),
(agent_play_sound, ":agent_id", ":sound_id"),
(else_try),
(play_sound, ":sound_id", 0),
(try_end),
...
(ti_on_weapon_attack, [(store_trigger_param_1, ":agent_id"), (call_script, "script_agent_play_sound", ":agent_id", "snd_k98")])