- Documentation
- Server functions
- triggerClientEventInRange
Function
triggerClientEventInRange
Sends an event only to the players within a sphere around a point. Returns the number of recipients.
Syntax
int triggerClientEventInRange(float x, float y, float z, float radius, int dimension, string name, element sourceElement [, mixed ...])Arguments
xfloat- Centre X.
yfloat- Centre Y.
zfloat- Centre Z.
radiusfloat- Radius in metres.
dimensionint- Dimension;
nilmeans every dimension. namestring- The event name.
sourceElementelement- The event's
source. ...mixed, optional- Event arguments.
Returns
The number of recipients.
Example
local x, y, z = getElementPosition(bomb)
triggerClientEventInRange(x, y, z, 100, getElementDimension(bomb), "onBombBeep", bomb)
See also
triggerClientEventSends an event from the server to one player, several players or everyone at once.triggerClientEventStreamedSends an event only to the players whose game has the element loaded (same dimension and interior, within streaming range: vehicles and objects 300 m, peds 250 m), plus the people inside that vehicle. For effects at the element: door sounds, sparks, animations.