case MSG_ANNCE:
{
typestring = "MSG_ANNCE";
- msg_info_notifs[nameid - 1] = notif;
+ msg_annce_notifs[nameid - 1] = notif;
notif.classname = "msg_annce_notification";
break;
}
#ifdef CSQC
if(snd != "")
{
- precache_sound(sprintf("announcer/%s/%s", autocvar_cl_announcer, snd));
+ precache_sound(sprintf("announcer/%s/%s.wav", autocvar_cl_announcer, snd));
notif.nent_channel = channel;
notif.nent_snd = strzone(snd);
notif.nent_vol = vol;
}
#ifdef CSQC
+void Local_Notification_sound(
+ float soundchannel, string soundfile,
+ float soundvolume, float soundposition)
+{
+ if((soundfile != prev_soundfile) || (time >= (prev_soundtime + autocvar_cl_announcer_antispam)))
+ {
+ #ifdef NOTIFICATIONS_DEBUG
+ dprint(sprintf(
+ "Local_Notification_sound(world, %f, '%s', %f, %f);\n",
+ soundchannel,
+ sprintf(
+ "announcer/%s/%s.wav",
+ autocvar_cl_announcer,
+ soundfile
+ ),
+ soundvolume,
+ soundposition
+ ));
+ #endif
+
+ sound(
+ world,
+ soundchannel,
+ sprintf(
+ "announcer/%s/%s.wav",
+ autocvar_cl_announcer,
+ soundfile
+ ),
+ soundvolume,
+ soundposition
+ );
+
+ if(prev_soundfile) { strunzone(prev_soundfile); }
+ prev_soundfile = strzone(soundfile);
+ prev_soundtime = time;
+ }
+ else
+ {
+ #ifdef NOTIFICATIONS_DEBUG
+ dprint(sprintf(
+ "Local_Notification_sound(world, %f, '%s', %f, %f) ^1BLOCKED BY ANTISPAM:^7 prevsnd: '%s', time/prevtime: %f, limit: %f\n",
+ soundchannel,
+ sprintf(
+ "announcer/%s/%s.wav",
+ autocvar_cl_announcer,
+ soundfile
+ ),
+ soundvolume,
+ soundposition,
+ prev_soundfile,
+ (time - prev_soundtime),
+ autocvar_cl_announcer_antispam
+ ));
+ #endif
+ }
+}
void Local_Notification_HUD_Notify_Push(
string icon, string hudargs,
string s1, string s2, string s3, string s4)
{
case MSG_ANNCE:
{
- print("blah blah\n");
+ #ifdef CSQC
+ Local_Notification_sound(
+ notif.nent_channel,
+ notif.nent_snd,
+ notif.nent_vol,
+ notif.nent_position
+ );
+ #else
+ backtrace("MSG_ANNCE on server?... Please notify Samual immediately!\n");
+ #endif
break;
}
f1, f2, f3, f4);
}
#ifdef CSQC
+ if(notif.nent_msgannce)
+ if(notif.nent_msgannce.nent_enabled)
+ {
+ Local_Notification_WOVA(
+ MSG_ANNCE,
+ notif.nent_msgannce.nent_id,
+ 0, 0,
+ "", "", "", "",
+ 0, 0, 0, 0);
+ }
if(notif.nent_msgcenter)
if(notif.nent_msgcenter.nent_enabled)
{