EntityStreamOut: Difference between revisions
No edit summary |
mNo edit summary |
||
| (One intermediate revision by one other user not shown) | |||
| Line 15: | Line 15: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<syntaxhighlight lang="c#"> | <syntaxhighlight lang="c#"> | ||
public void | public void OnEntityStreamOut(RAGE.Elements.Entity entity) | ||
{ | { | ||
RAGE.Chat.Output($"{entity.Model} streamed out at {entity.Position} with serverside id:{entity.RemoteId}"); | RAGE.Chat.Output($"{entity.Model} streamed out at {entity.Position} with serverside id:{entity.RemoteId}"); | ||
| Line 39: | Line 39: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
}} | }} | ||
[[Category:Entity API]] | |||
[[Category:Client-side Event]] | |||
Latest revision as of 11:06, 30 April 2019
This event is called everytime a entity goes out of player's streaming range.
Client-Side Event
C# Syntax
public delegate void OnEntityStreamOutDelegate(Entity entity);
Parameters
- entity - the streamed entity, expects RAGE.Elements.Entity
Example
The example below sends a message to client when an entity leave the stream range, showing the entity model, position and remoteId.
Events.OnEntityStreamOut += OnEntityStreamOut;
public void OnEntityStreamOut(RAGE.Elements.Entity entity)
{
RAGE.Chat.Output($"{entity.Model} streamed out at {entity.Position} with serverside id:{entity.RemoteId}");
}
JavaScript Syntax
mp.events.add('entityStreamOut', (entity) => {});
Parameters
- entity: The entity handler, output expects any type.
Example
The example below shows up a message for a player when an entity streams out.
mp.events.add('entityStreamOut', (entity) => {
mp.gui.chat.push('Entity is gone, but never gonna give you up, never gonna let you down...');
});