EntityStreamIn: Difference between revisions
No edit summary |
m (Replaced HTML with template) |
||
| Line 1: | Line 1: | ||
This event is triggered when a car or player enters the stream zone | This event is triggered when a car or player enters the stream zone | ||
==Example== | ==Example== | ||
{{ClientsideCode| | |||
< | <pre> | ||
// Other player streams in | // Other player streams in | ||
mp.events.add('entityStreamIn', (entity) => { | mp.events.add('entityStreamIn', (entity) => { | ||
const isInvincible = entity.getVariable('isInvincible'); | const isInvincible = entity.getVariable('isInvincible'); | ||
entity.setInvincible(!!isInvincible); | entity.setInvincible(!!isInvincible); | ||
}); | }); | ||
</pre> | |||
</ | }} | ||
Revision as of 12:53, 26 October 2018
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);
});