From b53947ccc306858ff0b4b4f4bfddf639f23f2418 Mon Sep 17 00:00:00 2001 From: Peace-Maker Date: Tue, 3 Mar 2015 17:22:01 +0100 Subject: [PATCH] Add TE_SendToAllInRange Add helper stock to mimic PVS and PAS recipient filters for tempents in the SDK. --- plugins/include/sdktools_tempents.inc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/plugins/include/sdktools_tempents.inc b/plugins/include/sdktools_tempents.inc index 3cb2da61..1a711a2e 100644 --- a/plugins/include/sdktools_tempents.inc +++ b/plugins/include/sdktools_tempents.inc @@ -226,3 +226,21 @@ stock TE_SendToClient(client, Float:delay=0.0) return TE_Send(players, 1, delay); } + +/** + * Sends the current TE to all clients that are in + * visible or audible range of the origin. + * @note See TE_Start(). + * @note See GetClientsInRange() + * + * @param origin Coordinates from which to test range. + * @param rangeType Range type to use for filtering clients. + * @param delay Delay in seconds to send the TE. + * @noreturn + */ +stock TE_SendToAllInRange(float origin[3], ClientRangeType rangeType, float delay=0.0) +{ + int[] clients = new int[MaxClients]; + int total = GetClientsInRange(origin, rangeType, clients, MaxClients); + return TE_Send(clients, total, delay); +} \ No newline at end of file