EntityStreamIn: Difference between revisions
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
This event is triggered when a car or player enters the stream zone | |||
==Example== | ==Example== | ||
| Line 9: | Line 11: | ||
mp.events.add('entityStreamIn', (entity) => { | mp.events.add('entityStreamIn', (entity) => { | ||
const isInvincible = entity.getVariable('isInvincible'); | |||
entity.setInvincible(!!isInvincible); | |||
}); | }); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</div> | </div> | ||
Revision as of 13:36, 18 December 2017
This event is triggered when a car or player enters the stream zone
Example
Client-Side
// Other player streams in
mp.events.add('entityStreamIn', (entity) => {
const isInvincible = entity.getVariable('isInvincible');
entity.setInvincible(!!isInvincible);
});