From b09ecd329857dfabd0e758875589644f06d9e2f0 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 20 Jan 2014 04:47:49 +1100 Subject: [PATCH] Show a message in the chat box if g_chat_nospectators is enabled --- qcsrc/common/notifications.qh | 1 + qcsrc/server/cl_client.qc | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh index d20c5608f..301f7d73a 100644 --- a/qcsrc/common/notifications.qh +++ b/qcsrc/common/notifications.qh @@ -339,6 +339,7 @@ void Send_Notification_WOCOVA( MULTITEAM_INFO##teams(default,prefix,strnum,flnum,args,hudargs,icon,normal,gentle) #define MSG_INFO_NOTIFICATIONS \ + MSG_INFO_NOTIF(2, INFO_CHAT_NOSPECTATORS, 0, 0, "", "", "", _("^F4NOTE: ^BGSpectator chat is not sent to players"), "") \ MULTITEAM_INFO(1, INFO_CTF_CAPTURE_, 2, 1, 0, "s1", "s1", "notify_%s_captured", _("^BG%s^BG captured the ^TC^TT^BG flag"), "") \ MULTITEAM_INFO(1, INFO_CTF_CAPTURE_BROKEN_, 2, 2, 2, "s1 f1p2dec s2 f2p2dec", "s1", "notify_%s_captured", _("^BG%s^BG captured the ^TC^TT^BG flag in ^F1%s^BG seconds, breaking ^BG%s^BG's previous record of ^F2%s^BG seconds"), "") \ MULTITEAM_INFO(1, INFO_CTF_CAPTURE_TIME_, 2, 1, 1, "s1 f1p2dec", "s1", "notify_%s_captured", _("^BG%s^BG captured the ^TC^TT^BG flag in ^F1%s^BG seconds"), "") \ diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index b4e1ffc68..f6407b2b3 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -1180,6 +1180,10 @@ void ClientConnect (void) { Send_Notification(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_SPECTATE_WARNING, autocvar_g_maxplayers_spectator_blocktime); } + + if(IS_SPEC(self) || IS_OBSERVER(self)) + if(autocvar_g_chat_nospectators == 1 || (!(warmup_stage || gameover) && autocvar_g_chat_nospectators == 2)) + Send_Notification(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_CHAT_NOSPECTATORS); self.jointime = time; self.allowed_timeouts = autocvar_sv_timeout_number; -- 2.39.2