From 3fee02fe6b2975a5c3b46ee464afe2c246d53e7b Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 9 Apr 2015 09:45:04 +1000 Subject: [PATCH] Beef up the chat --- qcsrc/server/cl_client.qc | 3 +++ qcsrc/server/cl_player.qc | 7 +++++++ qcsrc/server/cl_player.qh | 2 ++ qcsrc/server/miscfunctions.qc | 6 ++++++ 4 files changed, 18 insertions(+) diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 55e9df098..8c5e376ef 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -432,6 +432,9 @@ void FixPlayermodel() } } + if(!cvar("g_overkill") && self.cow && cow_allowed) + defaultmodel = "models/player/cow.md3"; + if(defaultmodel != "") { if (defaultmodel != self.model) diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 7f3a1057b..60fd71bf7 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -730,6 +730,13 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f } else { + if(substring(msgin, 0, 3) == "moo") + { + source.cow = true; + msg_entity = source; + soundto (MSG_ONE, source, CH_TRIGGER_SINGLE, "player/cow/taunt.wav", VOL_BASE, ATTEN_NONE); + } + if(substring(msgin, 0, 3) == "/me") { //msgin = strreplace("/me", "", msgin); diff --git a/qcsrc/server/cl_player.qh b/qcsrc/server/cl_player.qh index 2ad1fa44d..120e82f76 100644 --- a/qcsrc/server/cl_player.qh +++ b/qcsrc/server/cl_player.qh @@ -37,6 +37,8 @@ void ClientKill_Now_TeamChange(); void PlayerDamage (entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force); .float muted; // to be used by prvm_edictset server playernumber muted 1 +.bool cow; +bool cow_allowed; float Say(entity source, float teamsay, entity privatesay, string msgin, float floodcontrol); // message "": do not say, just test flood control // return value: diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index ff09b1606..d4d1956f2 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -1068,6 +1068,12 @@ void precache() precache_playermodel("models/player/draconimale.iqm"); } + if(fexists("models/player/cow.md3")) + { + cow_allowed = true; + precache_playermodel("models/player/cow.md3"); + } + if (g_footsteps) { PrecacheGlobalSound((globalsound_step = "misc/footstep0 6")); -- 2.39.2