registercvar("cl_weapon_switch_fallback_to_impulse", "1");
registercvar("cl_allow_uidranking", "1");
+
+ // z411
+ registercvar("cl_chat_sounds", "1");
if(autocvar_cl_lockview)
cvar_set("cl_lockview", "0");
float cvar_cl_autotaunt;
float cvar_cl_clippedspectating;
int cvar_cl_gunalign;
+ bool cvar_cl_chat_sounds;
float cvar_cl_handicap;
float cvar_cl_jetpack_jump;
float cvar_cl_movement_track_canjump;
#elif defined(SVQC)
.float cvar_cl_handicap;
.int cvar_cl_gunalign;
+ .bool cvar_cl_chat_sounds;
.float cvar_cl_clippedspectating;
.float cvar_cl_autoscreenshot;
.float cvar_cl_jetpack_jump;
REPLICATE(cvar_cl_autotaunt, float, "cl_autotaunt");
REPLICATE(cvar_cl_clippedspectating, bool, "cl_clippedspectating");
REPLICATE(cvar_cl_gunalign, int, "cl_gunalign");
+REPLICATE(cvar_cl_chat_sounds, bool, "cl_chat_sounds");
REPLICATE(cvar_cl_handicap, float, "cl_handicap");
REPLICATE(cvar_cl_jetpack_jump, bool, "cl_jetpack_jump");
REPLICATE(cvar_cl_movement_track_canjump, bool, "cl_movement_track_canjump");
bool autocvar_g_forced_respawn;
string autocvar_g_forced_team_otherwise; // TODO: Move to teamplay.qc
-bool autocvar_g_chat_sounds; // z411
-string autocvar_g_chat_sounds_list; // z411
-float autocvar_g_chat_sounds_flood; // z411
-bool autocvar_g_jingle_end; // z411
-string autocvar_g_jingle_end_list; // z411
-float autocvar_g_jingle_end_volume; // z411
+bool autocvar_sv_chat_sounds; // z411
+string autocvar_sv_chat_sounds_list; // z411
+float autocvar_sv_chat_sounds_flood; // z411
+bool autocvar_sv_jingle_end; // z411
+string autocvar_sv_jingle_end_list; // z411
+float autocvar_sv_jingle_end_volume; // z411
#define autocvar_g_friendlyfire cvar("g_friendlyfire")
#define autocvar_g_friendlyfire_virtual cvar("g_friendlyfire_virtual")
bool play_chatsound(entity source, string msgin)
{
- if(autocvar_g_chat_sounds) {
+ if(autocvar_sv_chat_sounds && CS(source).cvar_cl_chat_sounds) {
var .float flood_sound = floodcontrol_chatsound;
- //bprintf("%d < %d", source.(flood_sound), time - autocvar_g_chat_sounds_flood);
-
- if (source.(flood_sound) < time - autocvar_g_chat_sounds_flood) {
+ if (source.(flood_sound) < time - autocvar_sv_chat_sounds_flood) {
string rawmsg;
rawmsg = strreplace("\n", " ", msgin);
- //bprintf("msg is %s and list is %s\n", rawmsg, autocvar_g_chat_sounds_list);
- if (findinlist_abbrev(rawmsg, autocvar_g_chat_sounds_list)) {
- play2all(strcat("sound/chat/", rawmsg, ".ogg"));
+ if (findinlist_abbrev(rawmsg, autocvar_sv_chat_sounds_list)) {
+ string sndname = strcat("sound/chat/", rawmsg, ".ogg");
+
+ FOREACH_CLIENT(IS_REAL_CLIENT(it) && CS(it).cvar_cl_chat_sounds, play2(it, sndname));
source.(flood_sound) = time;
return true;
.string playerskin;
void ClientState_attach(entity this);
-void play_chatsound(entity source, string msgin);
+bool play_chatsound(entity source, string msgin);
IntrusiveList g_players;
STATIC_INIT(g_players) { g_players = IL_NEW(); }
ATTRIB(Client, cvar_cl_pokenade_type, string, this.cvar_cl_pokenade_type);
ATTRIB(Client, cvar_cl_spawn_near_teammate, bool, this.cvar_cl_spawn_near_teammate);
ATTRIB(Client, cvar_cl_gunalign, int, this.cvar_cl_gunalign);
+ ATTRIB(Client, cvar_cl_chat_sounds, bool, this.cvar_cl_chat_sounds);
ATTRIB(Client, cvar_cl_handicap, float, this.cvar_cl_handicap);
ATTRIB(Client, cvar_cl_clippedspectating, bool, this.cvar_cl_clippedspectating);
ATTRIB(Client, cvar_cl_autoscreenshot, int, this.cvar_cl_autoscreenshot);
{
case CMD_REQUEST_COMMAND:
{
- sprint(caller, strcat("Available sounds: \n\n", autocvar_g_chat_sounds_list, "\n"));
+ sprint(caller, strcat("Available sounds: \n\n", autocvar_sv_chat_sounds_list, "\n"));
return; // never fall through to usage
}
BADPREFIX("sv_timeout_");
BADPREFIX("sv_vote_");
BADPREFIX("timelimit_");
- BADPREFIX("g_jingle_");
+ BADPREFIX("sv_chat_");
+ BADPREFIX("sv_jingle_");
// allowed changes to server admins (please sync this to server.cfg)
// vi commands:
target_music_kill();
// z411
- if(autocvar_g_jingle_end) {
+ if(autocvar_sv_jingle_end) {
int jingles_len = 0;
string jingles[32];
jingles[0] = "";
- FOREACH_WORD(autocvar_g_jingle_end_list, it,
+ FOREACH_WORD(autocvar_sv_jingle_end_list, it,
{
jingles[jingles_len] = it;
jingles_len++;
FOREACH_CLIENT(IS_REAL_CLIENT(it),
{
stuffcmd(it, "cd stop\n");
- _sound(it, CH_INFO, strcat("jingle/", jingles[song_to_play], ".ogg"), VOL_BASE * autocvar_g_jingle_end_volume, ATTEN_NORM);
+ _sound(it, CH_INFO, strcat("jingle/", jingles[song_to_play], ".ogg"), VOL_BASE * autocvar_sv_jingle_end_volume, ATTEN_NORM);
});
}
}