From 0c0ce1adfc2bf37517a4819b52c6a14d4b29ee96 Mon Sep 17 00:00:00 2001 From: BotoX Date: Thu, 18 Aug 2016 06:52:00 +0200 Subject: [PATCH] added game_playerdie and game_playerkill output to ZR as described here: https://developer.valvesoftware.com/wiki/Trigger_brush --- src/zr/api/infect.api.inc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/zr/api/infect.api.inc b/src/zr/api/infect.api.inc index e237c9c..bd071f8 100644 --- a/src/zr/api/infect.api.inc +++ b/src/zr/api/infect.api.inc @@ -178,6 +178,22 @@ APIOnClientInfected(client, attacker, bool:motherinfect, bool:respawnoverride, b // Finish the call. Call_Finish(); + + // Forward event to map. + if(!motherinfect) + { + int entity = INVALID_ENT_REFERENCE; + while((entity = FindEntityByClassname(entity, "trigger_brush")) != INVALID_ENT_REFERENCE) + { + static char sTargetname[64]; + GetEntPropString(entity, Prop_Data, "m_iName", sTargetname, sizeof(sTargetname)); + + if(StrEqual(sTargetname, "game_playerdie")) + AcceptEntityInput(entity, "Use", client, client); + else if(StrEqual(sTargetname, "game_playerkill")) + AcceptEntityInput(entity, "Use", attacker, attacker); + } + } } /**