- Documentation
- Server functions
- triggerClientEventStreamed
Function
triggerClientEventStreamed
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)