EntityOverlayBatch:valid

From RAGE Multiplayer Wiki
Revision as of 10:56, 4 August 2024 by Shr0x (talk | contribs) (Created page with " {{ClientsideJsFunction}} {{JSContainer| This property will return whether an entity overlay is valid or not. *Note: This property is readonly. ===Return value=== *''' {{RageType|boolean}} ''' ==Syntax== <syntaxhighlight lang="javascript"> batch.valid </syntaxhighlight> ==Example== <syntaxhighlight lang="javascript"> //Enable entity overlay mp.game.graphics.setEntityOverlayPassEnabled(true); //Create new entity overlay batch let batch = mp.game.graphics.createEntityO...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Client-Side
Function

 JavaScript



JavaScript Syntax

This property will return whether an entity overlay is valid or not.

  • Note: This property is readonly.

Return value

  • boolean

Syntax

batch.valid

Example

//Enable entity overlay
mp.game.graphics.setEntityOverlayPassEnabled(true);

//Create new entity overlay batch
let batch = mp.game.graphics.createEntityOverlayBatch(overlayParams);

//Add a vehicle to overlay batch once the player enters in them.
mp.events.add('playerEnterVehicle', (vehicle) => {
    //check if entity overlay is valid before adding a new entity to it
    if (batch.valid) {
        batch.add(vehicle);
    }
});


See also