TextDrawSetSelectable

From SA-MP Wiki

Jump to: navigation, search


Description:

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


TextDrawSetSelectable was added in SA-MP 0.3e This function was added in SA-MP 0.3e and will not work in earlier versions!


Parameters:
(Text:text, set)
textThe ID of the textdraw to make selectable.
set1 to make it selectable, or 0 to make it not selectable.


Return Values:

This function does not return any specific values.


Image:32px-Circle-style-warning.png

Important
Note

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


Tip

Image:Light_bulb_icon.png

Use TextDrawTextSize to define the clickable area.


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

Related Functions

The following functions may be useful, as they are related to this function in one way or another.

  • SelectTextDraw: Enables the mouse, so the player can select a textdraw


Related Callbacks

The following callbacks might be useful, as they're related to this function in one way or another.

Personal tools
Navigation
Toolbox
In other languages