---
title: "TextDrawSetSelectable | open.mp"
description: "Sets whether a textdraw can be selected (clicked on) or not."
canonical: https://omp.itsneufox.com/th/docs/scripting/functions/TextDrawSetSelectable
language: th
---

# TextDrawSetSelectable

## คำอธิบาย

Sets whether a textdraw can be selected (clicked on) or not

| Name | Description |
| --- | --- |
| text | The ID of the textdraw to make selectable. |
| bool:set | 'true' to make it selectable, or 'false' to make it not selectable. |

## ส่งคืน

This function does not return any specific values.

## ตัวอย่าง

```c
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp(cmdtext, "/selectd", true))
    {
        for (new i = 0; i < MAX_TEXT_DRAWS; i++)
        {
            TextDrawSetSelectable(Text:i, true);
        }
        SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: All textdraws can be selected now!");
        return 1;
    }
    return 0;
}
```

## บันทึก

เคล็ดลับ

Use [TextDrawTextSize](https://omp.itsneufox.com/th/docs/scripting/functions/TextDrawTextSize) to define the clickable area.

warning

TextDrawSetSelectable must be used BEFORE the textdraw is shown to players for it to be selectable.

## ฟังก์ชั่นที่เกี่ยวข้องกัน

-   [SelectTextDraw](https://omp.itsneufox.com/th/docs/scripting/functions/SelectTextDraw): Enables the mouse, so the player can select a textdraw
-   [CancelSelectTextDraw](https://omp.itsneufox.com/th/docs/scripting/functions/CancelSelectTextDraw): Cancel textdraw selection with the mouse

## Related Callbacks

-   [OnPlayerClickTextDraw](https://omp.itsneufox.com/th/docs/scripting/callbacks/OnPlayerClickTextDraw): Called when a player clicks on a textdraw.
