GLOBAL_TD[14] = TextDrawCreate(550.000000, 136.000000, "YES"); TextDrawBackgroundColor(GLOBAL_TD[14], 255); TextDrawFont(GLOBAL_TD[14], 3); TextDrawLetterSize(GLOBAL_TD[14], 0.340000, 1.300000); TextDrawColor(GLOBAL_TD[14], 65535); TextDrawSetOutline(GLOBAL_TD[14], 0); TextDrawSetProportional(GLOBAL_TD[14], 0); TextDrawSetShadow(GLOBAL_TD[14], 1); TextDrawSetSelectable(GLOBAL_TD[14], true); GLOBAL_TD[15] = TextDrawCreate(589.000000, 136.000000, "NO"); TextDrawBackgroundColor(GLOBAL_TD[15], 255); TextDrawFont(GLOBAL_TD[15], 3); TextDrawLetterSize(GLOBAL_TD[15], 0.340000, 1.300000); TextDrawColor(GLOBAL_TD[15], -16776961); TextDrawSetOutline(GLOBAL_TD[15], 0); TextDrawSetProportional(GLOBAL_TD[15], 0); TextDrawSetShadow(GLOBAL_TD[15], 1); TextDrawSetSelectable(GLOBAL_TD[15], true);
GLOBAL_TD[14] = TextDrawCreate(550.000000, 136.000000, "YES"); TextDrawBackgroundColor(GLOBAL_TD[14], 255); TextDrawFont(GLOBAL_TD[14], 3); TextDrawLetterSize(GLOBAL_TD[14], 0.340000, 1.299999); TextDrawColor(GLOBAL_TD[14], 65535); TextDrawSetOutline(GLOBAL_TD[14], 0); TextDrawSetProportional(GLOBAL_TD[14], 0); TextDrawSetShadow(GLOBAL_TD[14], 1); TextDrawUseBox(GLOBAL_TD[14], 1); TextDrawBoxColor(GLOBAL_TD[14], 0); TextDrawTextSize(GLOBAL_TD[14], 570.000000, 0.000000); TextDrawAlignment(GLOBAL_TD[14], 0); TextDrawSetSelectable(Text:GLOBAL_TD[14], true); GLOBAL_TD[15] = TextDrawCreate(589.000000, 136.000000, "NO"); TextDrawBackgroundColor(GLOBAL_TD[15], 255); TextDrawFont(GLOBAL_TD[15], 3); TextDrawLetterSize(GLOBAL_TD[15], 0.340000, 1.299999); TextDrawColor(GLOBAL_TD[15], -16776961); TextDrawSetOutline(GLOBAL_TD[15], 0); TextDrawSetProportional(GLOBAL_TD[15], 0); TextDrawSetShadow(GLOBAL_TD[15], 1); TextDrawUseBox(GLOBAL_TD[15], 1); TextDrawBoxColor(GLOBAL_TD[15], 0); TextDrawTextSize(GLOBAL_TD[15], 602.000000, 0.000000); TextDrawAlignment(GLOBAL_TD[15], 0); TextDrawSetSelectable(Text:GLOBAL_TD[15], true);
TextDrawSetSelectable(Text:i, 1);
TextDrawSetSelectable is key here. You need to use that on the textdraws you want to be able to select.
pawn Код:
|
TextDrawSetSelectable(Text:GLOBAL_TD[15], true);
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(clickedid == GLOBAL_TD[15])
{
//your functions
CancelSelectTextDraw(playerid);
}
return 1;
}
pawn Код:
|
TextDrawSetSelectable(GLOBAL_TD[14], 1);
Name[playerid] = CreatePlayerTextDraw(playerid, 550.000000, 136.000000, "YES"); PlayerTextDrawSetSelectable(playerid, Name[playerid], 1);
I'm always using player textdraw for clickable textdraws.
In your case I think you don't need that Text: Код:
TextDrawSetSelectable(GLOBAL_TD[14], 1); Код:
Name[playerid] = CreatePlayerTextDraw(playerid, 550.000000, 136.000000, "YES"); PlayerTextDrawSetSelectable(playerid, Name[playerid], 1); |
TextDrawTextSize(GLOBAL_TD[15], 602.000000, 0.000000);