From 8592279c470e36120e12258eea0406ae81f2ff40 Mon Sep 17 00:00:00 2001 From: Samual Lenks Date: Wed, 17 Apr 2013 18:53:36 -0400 Subject: [PATCH] Work more on announcements --- qcsrc/common/notifications.qc | 26 ++++++++++++++++++++++++-- qcsrc/server/w_grenadelauncher.qc | 4 ++-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/qcsrc/common/notifications.qc b/qcsrc/common/notifications.qc index fbed3e589..837168586 100644 --- a/qcsrc/common/notifications.qc +++ b/qcsrc/common/notifications.qc @@ -373,7 +373,7 @@ void Create_Notification_Entity( case MSG_ANNCE: { typestring = "MSG_ANNCE"; - msg_info_notifs[nameid - 1] = notif; + msg_annce_notifs[nameid - 1] = notif; notif.classname = "msg_annce_notification"; break; } @@ -910,6 +910,7 @@ void Local_Notification_centerprint_generic( #endif centerprint_generic(cpid, input, stof(arg_slot[0]), stof(arg_slot[1])); } +string previous_announcement; #endif void Local_Notification(float net_type, float net_name, ...count) @@ -982,7 +983,28 @@ void Local_Notification(float net_type, float net_name, ...count) { case MSG_ANNCE: { - print("blah blah\n"); + #ifdef CSQC + if((notif.nent_snd != previous_announcement) || (time >= (previous_announcement_time + autocvar_cl_announcer_antispam))) + { + sound( + world, + notif.nent_channel, + sprintf( + "announcer/%s/%s", + autocvar_cl_announcer, + notif.nent_snd + ), + notif.nent_vol, + notif.nent_position + ); + + if(previous_announcement) { strunzone(previous_announcement); } + previous_announcement = strzone(notif.nent_snd); + previous_announcement_time = time; + } + #else + print("MSG_ANNCE on server?...\n"); + #endif break; } diff --git a/qcsrc/server/w_grenadelauncher.qc b/qcsrc/server/w_grenadelauncher.qc index b463a4e71..cdcf841e0 100644 --- a/qcsrc/server/w_grenadelauncher.qc +++ b/qcsrc/server/w_grenadelauncher.qc @@ -12,7 +12,7 @@ void W_Grenade_Explode (void) if(IsDifferentTeam(self.realowner, other)) if(other.deadflag == DEAD_NO) if(IsFlying(other)) - AnnounceTo(self.realowner, "airshot"); + Send_Notification(NOTIF_ONE, self.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_AIRSHOT); self.event_damage = func_null; self.takedamage = DAMAGE_NO; @@ -32,7 +32,7 @@ void W_Grenade_Explode2 (void) if(IsDifferentTeam(self.realowner, other)) if(other.deadflag == DEAD_NO) if(IsFlying(other)) - AnnounceTo(self.realowner, "airshot"); + Send_Notification(NOTIF_ONE, self.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_AIRSHOT); self.event_damage = func_null; self.takedamage = DAMAGE_NO; -- 2.39.2