14.08.2016, 07:07
I was trying to create an ATM textdraw and I was having a hard time on making the boxes selectable. You may notice on the code that I have used (2x) ~n~ for the Deposit, Withdraw and Transaction. Originally it was suppose to be separated, but to avoid consuming too much of textdraws I decided to use the ~n~ instead. Now, that isn't the problem. The problem is that the boxes, The area part of the boxes should be selectable. But OnPlayerClickTextdraw doesn't detect them, I have used two textdraw editor and still I have no luck.
Can you guys help me out, figure out what is the problem? There is another problem as well, Only Transaction shows up and not Deposit & Withdraw.
Can you guys help me out, figure out what is the problem? There is another problem as well, Only Transaction shows up and not Deposit & Withdraw.
PHP Code:
// ATM Textdraws @ Under OnGameModeInit
Textdraw0 = TextDrawCreate(467.599945, 123.206672, "usebox");
TextDrawLetterSize(Textdraw0, 0.000000, 28.139629);
TextDrawTextSize(Textdraw0, 178.000030, 0.000000);
TextDrawAlignment(Textdraw0, 1);
TextDrawColor(Textdraw0, 0);
TextDrawUseBox(Textdraw0, true);
TextDrawBoxColor(Textdraw0, 102);
TextDrawSetShadow(Textdraw0, 0);
TextDrawSetOutline(Textdraw0, 0);
TextDrawFont(Textdraw0, 0);
Textdraw1 = TextDrawCreate(459.599975, 131.419998, "usebox");
TextDrawLetterSize(Textdraw1, 0.000000, 26.314445);
TextDrawTextSize(Textdraw1, 184.399993, 0.000000);
TextDrawAlignment(Textdraw1, 1);
TextDrawColor(Textdraw1, 0);
TextDrawUseBox(Textdraw1, true);
TextDrawBoxColor(Textdraw1, 866792447);
TextDrawSetShadow(Textdraw1, 0);
TextDrawSetOutline(Textdraw1, 0);
TextDrawFont(Textdraw1, 0);
Textdraw2 = TextDrawCreate(323.200134, 135.893371, "Welcome~n~ATM Machine");
TextDrawLetterSize(Textdraw2, 0.597999, 2.361599);
TextDrawAlignment(Textdraw2, 2);
TextDrawColor(Textdraw2, -1);
TextDrawSetShadow(Textdraw2, 0);
TextDrawSetOutline(Textdraw2, 1);
TextDrawBackgroundColor(Textdraw2, 51);
TextDrawFont(Textdraw2, 2);
TextDrawSetProportional(Textdraw2, 1);
Textdraw3 = TextDrawCreate(323.199859, 225.493286, "Deposit~n~~n~Withdraw~n~~n~Transaction");
TextDrawLetterSize(Textdraw3, 0.527598, 1.958400);
TextDrawAlignment(Textdraw3, 2);
TextDrawColor(Textdraw3, -1);
TextDrawSetShadow(Textdraw3, 0);
TextDrawSetOutline(Textdraw3, 1);
TextDrawBackgroundColor(Textdraw3, 51);
TextDrawFont(Textdraw3, 1);
TextDrawSetProportional(Textdraw3, 1);
Textdraw4 = TextDrawCreate(270.000000, 227.000000, "_");
TextDrawBackgroundColor(Textdraw4, 255);
TextDrawFont(Textdraw4, 1);
TextDrawLetterSize(Textdraw4, 0.500000, 2.000000);
TextDrawColor(Textdraw4, 0);
TextDrawSetOutline(Textdraw4, 0);
TextDrawSetProportional(Textdraw4, 1);
TextDrawSetShadow(Textdraw4, 1);
TextDrawUseBox(Textdraw4, 1);
TextDrawBoxColor(Textdraw4, 65535);
TextDrawTextSize(Textdraw4, 377.000000, 0.000000);
TextDrawSetSelectable(Textdraw4, 1);
Textdraw5 = TextDrawCreate(270.000000, 262.000000, "_");
TextDrawBackgroundColor(Textdraw5, 255);
TextDrawFont(Textdraw5, 1);
TextDrawLetterSize(Textdraw5, 0.500000, 2.000000);
TextDrawColor(Textdraw5, 0);
TextDrawSetOutline(Textdraw5, 0);
TextDrawSetProportional(Textdraw5, 1);
TextDrawSetShadow(Textdraw5, 1);
TextDrawUseBox(Textdraw5, 1);
TextDrawBoxColor(Textdraw5, 65535);
TextDrawTextSize(Textdraw5, 377.000000, 0.000000);
TextDrawSetSelectable(Textdraw5, 1);
Textdraw6 = TextDrawCreate(270.000000, 296.000000, "_");
TextDrawBackgroundColor(Textdraw6, 255);
TextDrawFont(Textdraw6, 1);
TextDrawLetterSize(Textdraw6, 0.500000, 2.000000);
TextDrawColor(Textdraw6, 0);
TextDrawSetOutline(Textdraw6, 0);
TextDrawSetProportional(Textdraw6, 1);
TextDrawSetShadow(Textdraw6, 1);
TextDrawUseBox(Textdraw6, 1);
TextDrawBoxColor(Textdraw6, 65535);
TextDrawTextSize(Textdraw6, 377.000000, 0.000000);
TextDrawSetSelectable(Textdraw6, 1);
// ATM Balance @ OnPlayerConnect
pTextdraws[9] = CreatePlayerTextDraw(playerid, 194.399978, 195.626708, "Current Balance: $0");
PlayerTextDrawLetterSize(playerid, pTextdraws[9], 0.309999, 1.137066);
PlayerTextDrawAlignment(playerid, pTextdraws[9], 1);
PlayerTextDrawColor(playerid, pTextdraws[9], -1);
PlayerTextDrawSetShadow(playerid, pTextdraws[9], 0);
PlayerTextDrawSetOutline(playerid, pTextdraws[9], 1);
PlayerTextDrawBackgroundColor(playerid, pTextdraws[9], 51);
PlayerTextDrawFont(playerid, pTextdraws[9], 3);
PlayerTextDrawSetProportional(playerid, pTextdraws[9], 1);