From: Samual Date: Mon, 15 Aug 2011 06:20:23 +0000 (-0400) Subject: Eventlog information for keepaway X-Git-Tag: xonotic-v0.6.0~40^2~19^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8c183d9cb9b8cac854d1863539f01a001bad2295;p=xonotic%2Fxonotic-data.pk3dir.git Eventlog information for keepaway --- diff --git a/qcsrc/server/mutators/gamemode_keepaway.qc b/qcsrc/server/mutators/gamemode_keepaway.qc index e71c2d7ef..35d6e0e97 100644 --- a/qcsrc/server/mutators/gamemode_keepaway.qc +++ b/qcsrc/server/mutators/gamemode_keepaway.qc @@ -3,6 +3,7 @@ void ka_TouchEvent(void); void ka_RespawnBall(void); void ka_DropEvent(entity); void ka_TimeScoring(void); +void ka_EventLog(string, entity); entity ka_ball; @@ -125,6 +126,7 @@ void ka_TouchEvent() // runs any time that the ball comes in contact with someth other.effects |= autocvar_g_keepaway_ballcarrier_effects; // messages and sounds + ka_EventLog("pickup", other); Send_KillNotification(other.netname, "", "", KA_PICKUPBALL, MSG_KA); WriteByte(MSG_BROADCAST, SVC_CENTERPRINT); WriteString(MSG_BROADCAST, strcat("\n\n", other.netname, "^7 has picked up the ball!\n")); @@ -167,6 +169,7 @@ void ka_DropEvent(entity plyr) // runs any time that a player is supposed to los plyr.effects &~= autocvar_g_keepaway_ballcarrier_effects; // messages and sounds + ka_EventLog("dropped", plyr); Send_KillNotification(plyr.netname, "", "", KA_DROPBALL, MSG_KA); WriteByte(MSG_BROADCAST, SVC_CENTERPRINT); WriteString(MSG_BROADCAST, strcat("\n\n", plyr.netname, "^7 has dropped the ball!\n")); @@ -205,6 +208,12 @@ void ka_TimeScoring() } } +void ka_EventLog(string mode, entity actor) // use an alias for easy changing and quick editing later +{ + if(autocvar_sv_eventlog) + GameLogEcho(strcat(":ka:", mode, ((actor != world) ? (strcat(":", ftos(actor.playerid))) : ""))); +} + MUTATOR_HOOKFUNCTION(ka_Scoring) { if((frag_attacker != frag_target) && (frag_attacker.classname == "player"))