OnElementStreamIn: Difference between revisions

From GTA Connected
Jump to navigation Jump to search
No edit summary
No edit summary
Tag: Manual revert
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{ScriptItem
{{ScriptItem2
|endpoint = shared
|name = onElementStreamIn
|side = shared
|type = event
|type = event
|name = onElementStreamIn
|games = iii vc sa iv
|parameter1 = Element element The element that has streamed in for a client.
|desc = an element streams in for a client
|parameter2 = Client client The client that the element has streamed in for. Server-side only.
|arg1 = Element element The element that has streamed in for a client.
|usage = an element streams in for a client
|arg2 = Client client The client that the element has streamed in for. Server-side only.
|callbackParametersSS = Event event, Element element, Client client
|cancel = true
|callbackParametersCS = Event event, Element element
|cancellable = true
|exampleJSSS = addEventHandler('OnElementStreamIn', (event, element, client) => {
|exampleJSSS = addEventHandler('OnElementStreamIn', (event, element, client) => {
messageClient('Element with id ' + element.id + ' has streamed in for ' + client.name, client, COLOUR_BLUE);
message('Element with id ' + element.id + ' has streamed in for ' + client.name, COLOUR_BLUE);
});
});
|exampleJSCS = addEventHandler('OnElementStreamIn', (event, element) => {
|exampleJSCS = addEventHandler('OnElementStreamIn', (event, element) => {
Line 16: Line 15:
});
});
|exampleLuaSS = addEventHandler('OnElementStreamIn', function(event, element, client)
|exampleLuaSS = addEventHandler('OnElementStreamIn', function(event, element, client)
messageClient('Element with id ' .. element.id .. ' has streamed in for a client.', client, COLOUR_RED)
message('Element with id ' .. element.id .. ' has streamed in for a client.', COLOUR_RED)
end)
end)
|exampleLuaCS = addEventHandler('OnElementStreamIn', function(event, element)
|exampleLuaCS = addEventHandler('OnElementStreamIn', function(event, element)

Latest revision as of 12:32, 22 December 2022

Event Server and Client icon-iii.png icon-vc.png icon-sa.png icon-iv.png Online and Offline Cancellable

Available since Server 1.0.0, Client 1.0.0

onElementStreamIn(Event event, Element element, Client client)

The onElementStreamIn event is invoked when an element streams in for a client.

Parameters

1) Event event The event object for this event.
2) Element element The element that has streamed in for a client.
3) Client client The client that the element has streamed in for. Server-side only.

Attributes

cancellable This event can be cancelled, by using event.preventDefault.

Notes

There aren't any notes for this event.

Examples

Example 1 - JavaScript - Server-Side:

addEventHandler('OnElementStreamIn', (event, element, client) => {
    message('Element with id ' + element.id + ' has streamed in for ' + client.name, COLOUR_BLUE);
});


Example 2 - JavaScript - Client-Side:

addEventHandler('OnElementStreamIn', (event, element) => {
    message('Element with id ' + element.id + ' has streamed in.', COLOUR_BLUE);
});


Example 3 - Lua - Server-Side:

addEventHandler('OnElementStreamIn', function(event, element, client)
    message('Element with id ' .. element.id .. ' has streamed in for a client.', COLOUR_RED)
end)


Example 4 - Lua - Client-Side:

addEventHandler('OnElementStreamIn', function(event, element)
    message('Element with id ' .. element.id .. ' has streamed in.', COLOUR_BLUE)
end)

Compatibility

There isn't any compatibility information for this event.

Related

Server Related

icon-iii.png icon-vc.png icon-sa.png icon-iv.png OnElementDestroy
icon-iii.png icon-vc.png icon-sa.png icon-iv.png OnElementStreamIn
icon-iii.png icon-vc.png icon-sa.png icon-iv.png OnElementStreamOut


Client Related

icon-iii.png icon-vc.png icon-sa.png icon-iv.png OnElementDestroy
icon-iii.png icon-vc.png icon-sa.png icon-iv.png OnElementStreamIn
icon-iii.png icon-vc.png icon-sa.png icon-iv.png OnElementStreamOut