Merge pull request #287 from peace-maker/tempent_range

Add TE_SendToAllInRange (r=psychonic).
This commit is contained in:
Nicholas Hastings 2015-03-06 15:19:24 -05:00
commit bfaedba9ed

View File

@ -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);
}