---
title: "IsObjectMaterialSlotUsed | open.mp"
description: "Verifica se um slot de material do objeto é usado."
canonical: https://omp.itsneufox.com/pt-BR/docs/scripting/functions/IsObjectMaterialSlotUsed
language: pt-BR
---

# IsObjectMaterialSlotUsed

aviso

Esta função foi adicionada no omp v1.1.0.2612 e não funcionará em versões anteriores!

## Descrição

Verifica se um slot de material do objeto é usado.

| Nome | Descrição |
| --- | --- |
| objectid | O ID do objeto. |
| materialIndex | O índice de material no objeto. (0 a 15) |

## Retornos

A função retorna o tipo de uso do slot de material.

`0` - Nenhum

`1` - Material

`2` - Texto

## Exemplos

```c
new objectid = CreateObject(19371, 978.71143, -925.25708, 42.63720,   0.00000, 0.00000, 2.00000);
SetObjectMaterial(objectid, 0, 19341, "egg_texts", "easter_egg01", 0xFFFFFFFF);

new type = IsObjectMaterialSlotUsed(objectid, 0);
// tipo = 1
```

Outro exemplo:

```c
new objectid = CreateObject(19174, 986.42767, -983.14850, 40.95220,   0.00000, 0.00000, 186.00000);
SetObjectMaterialText(objectid, "OPEN.MP", 0, OBJECT_MATERIAL_SIZE_256x128, "Arial", 38, true, 0xFF0000FF, 0x00000000, OBJECT_MATERIAL_TEXT_ALIGN_LEFT);

new type = IsObjectMaterialSlotUsed(objectid, 0);
// tipo = 2
```

## Funções Relacionadas

-   [SetObjectMaterial](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/SetObjectMaterial): Substitua a textura de um objeto pela textura de outro modelo do jogo.
-   [SetObjectMaterialText](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/SetObjectMaterialText): Substitua a textura de um objeto por texto.
-   [GetObjectMaterial](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/GetObjectMaterial): Obtenha os dados do material de um índice do objeto.
-   [GetObjectMaterialText](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/GetObjectMaterialText): Obtenha os dados do texto do material de um índice do objeto.
-   [IsPlayerObjectMaterialSlotUsed](https://omp.itsneufox.com/pt-BR/docs/scripting/functions/IsPlayerObjectMaterialSlotUsed): Verifica se um slot de material de objeto de jogador é usado.
