alt.isTextureExistInArchetype

Used to check if a texture currently exists on a model.

Useful for attaching a WebView to a specific texture on a model.

Returns a boolean. (true / false)

Declaration

alt.isTextureExistInArchetype(modelHash: number, textureName: string): boolean

Usage

const result = alt.isTextureExistInArchetype(someModelHash, someTextureName);

Real World Example

const model = 'v_ilev_cin_screen';
const texture = 'script_rt_cinscreen';
const hash = alt.hash(model);
const result = alt.isTextureExistInArchetype(hash, texture);

if (result) {
    console.log(`Model with texture exists!`);
} else {
    console.log(`Could not find model with texture.`);
}

These examples assume you have imported alt from alt-client.

results matching ""

    No results matching ""