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

Function

triggerClientEventStreamed

ServerEventsTrilogy Hub only

Sends 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.

Syntax

int triggerClientEventStreamed(element element, string name, element sourceElement [, mixed ...])

Arguments

elementelement
The element the effect is about.
namestring
The event name.
sourceElementelement
The event's source.
...mixed, optional
Event arguments.

Returns

The number of recipients.

Example

addCommandHandler("klakson", function(player)
    local veh = getPedOccupiedVehicle(player)
    if veh then triggerClientEventStreamed(veh, "onHornMelody", veh) end
end)

See also