PlayerTextDrawSetSelectable
From SA-MP Wiki
(Difference between revisions)
Revision as of 22:20, 21 April 2014 MP2 (Talk | contribs) ← Previous diff |
Current revision MP2 (Talk | contribs) |
||
Line 13: | Line 13: | ||
{{Note2|PlayerTextDrawSetSelectable MUST be used BEFORE the textdraw is shown to the player.}} | {{Note2|PlayerTextDrawSetSelectable MUST be used BEFORE the textdraw is shown to the player.}} | ||
+ | |||
+ | {{tip|Use [[PlayerTextDrawTextSize]] to define the clickable area.}} | ||
{{Example}} | {{Example}} |
Current revision
Description:
Toggles whether a player-textdraw can be selected or not.
(playerid, PlayerText:text, set)
playerid | The ID of the player whose player-textdraw to set the selectability of. |
PlayerText:text | The ID of the player-textdraw to set the selectability of. |
set | Set the player-textdraw selectable (1) or non-selectable (0). By default this is 0. |
Return Values:
This function does not return any specific values.
Tip | Use PlayerTextDrawTextSize to define the clickable area. |
Example Usage:
public OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp(cmdtext, "/select_ptd", true)) { for(new i = 0; i < MAX_PLAYER_TEXT_DRAWS; i++) PlayerTextDrawSetSelectable(playerid, PlayerText:i, 1); SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: All player-textdraws can be selected now!"); return 1; } return 0; }
[edit]
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
- CancelSelectTextDraw: Cancel textdraw selection with the mouse
[edit]
Related Callbacks
The following callbacks might be useful, as they're related to this function in one way or another.
- OnPlayerClickPlayerTextDraw: Called when a player clicks on a player-textdraw.