ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. triggerClientEventInRange

Function

triggerClientEventInRange

ServerEventsTrilogy Hub only

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; nil means 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