// On top of script
enum some_enum {
Text:TD_gametype,
Text:TD_leftbutton,
Text:TD_rightbutton,
Text:TD_bottomline,
Text:TD_topline,
Text:TD_leftline,
Text:TD_rightline,
};
new GT[MAX_PLAYERS][some_enum];
// Under ongamemodeinit (this works)
GT[playerid][TD_leftbutton] = TextDrawCreate(204.000000, 365.000000, "<");
TextDrawAlignment(GT[playerid][TD_leftbutton], 2);
TextDrawBackgroundColor(GT[playerid][TD_leftbutton], 255);
TextDrawFont(GT[playerid][TD_leftbutton], 1);
TextDrawLetterSize(GT[playerid][TD_leftbutton], 0.469999, 3.699998);
TextDrawColor(GT[playerid][TD_leftbutton], -1);
TextDrawSetOutline(GT[playerid][TD_leftbutton], 1);
TextDrawSetProportional(GT[playerid][TD_leftbutton], 1);
TextDrawUseBox(GT[playerid][TD_leftbutton], 1);
TextDrawBoxColor(GT[playerid][TD_leftbutton], 255);
TextDrawTextSize(GT[playerid][TD_leftbutton], 0.000000, 34.000000);
TextDrawSetSelectable(GT[playerid][TD_leftbutton], 1);
GT[playerid][TD_rightbutton] = TextDrawCreate(434.000000, 365.000000, ">");
TextDrawAlignment(GT[playerid][TD_rightbutton], 2);
TextDrawBackgroundColor(GT[playerid][TD_rightbutton], 255);
TextDrawFont(GT[playerid][TD_rightbutton], 1);
TextDrawLetterSize(GT[playerid][TD_rightbutton], 0.469999, 3.699998);
TextDrawColor(GT[playerid][TD_rightbutton], -1);
TextDrawSetOutline(GT[playerid][TD_rightbutton], 1);
TextDrawSetProportional(GT[playerid][TD_rightbutton], 1);
TextDrawUseBox(GT[playerid][TD_rightbutton], 1);
TextDrawBoxColor(GT[playerid][TD_rightbutton], 255);
TextDrawTextSize(GT[playerid][TD_rightbutton], 0.000000, 34.000000);
TextDrawSetSelectable(GT[playerid][TD_rightbutton], 1);
public OnPlayerClickTextDraw(playerid, Text:clickedid) {
// This DOES get called when I press exit (as it's supposed to)
if(clickedid == GT[playerid][TD_leftbutton]) {
// This isnt working
}
else if(clickedid == GT[playerid][TD_rightbutton]) {
// this isnt working either
}
}
https://sampwiki.blast.hk/wiki/SelectTextdraw
Everything else is fine, you just need to enable text draw selecting... |
I also enable "SelectTextDraw(playerid, color)" The following callback gets called when I press exit (so I assume thats working) but it won't work for either of my textdraws. |
TextDrawTextSize(GT[playerid][TD_leftbutton], 260.000000, 365.000000);
TextDrawTextSize(GT[playerid][TD_rightbutton], 500.000000, 365.000000);
This problem is probably coming from your TextDrawTextSize. Try tweaking with the coordinates a little see what happens.
I tweaked with them a little bit for you. pawn Код:
|
Glad to help
![]() It is like your TextSize X coordinate should be higher than your TextDraw X coordinate. |