SelectableTextdraw Problem
#1

hi guys so this is my code :
Код:
new Text:Passl9;
new Text:Passl10;
new Text:Passl11;
/////////////////////////////

Passl7 = TextDrawCreate(405.000305, 198.633346, "usebox");
TextDrawLetterSize(Passl7, 0.000000, 16.074449);
TextDrawTextSize(Passl7, 353.200286, 0.000000);
TextDrawAlignment(Passl7, 1);
TextDrawColor(Passl7, 42);
TextDrawUseBox(Passl7, true);
TextDrawBoxColor(Passl7, 8388863);
TextDrawSetShadow(Passl7, 0);
TextDrawSetOutline(Passl7, 0);
TextDrawBackgroundColor(Passl7, 16711935);
TextDrawFont(Passl7, 0);
TextDrawSetSelectable(Passl7, true);


Passl9 = TextDrawCreate(265.600036, 282.006866, "usebox");
TextDrawLetterSize(Passl9, 0.000000, 2.047780);
TextDrawTextSize(Passl9, 227.600006, 0.000000);
TextDrawAlignment(Passl9, 1);
TextDrawColor(Passl9, 529269450);
TextDrawUseBox(Passl9, true);
TextDrawBoxColor(Passl9, 572662218);
TextDrawSetShadow(Passl9, 0);
TextDrawSetOutline(Passl9, 0);
TextDrawBackgroundColor(Passl9, -1061109505);
TextDrawFont(Passl9, 1);
TextDrawSetSelectable(Passl9, true);

Passl10 = TextDrawCreate(352.199981, 242.686614, "usebox");
TextDrawLetterSize(Passl10, 0.000000, 2.047780);
TextDrawTextSize(Passl10, 313.199951, 0.000000);
TextDrawAlignment(Passl10, 1);
TextDrawColor(Passl10, 529269450);
TextDrawUseBox(Passl10, true);
TextDrawBoxColor(Passl10, 572662218);
TextDrawSetShadow(Passl10, 0);
TextDrawSetOutline(Passl10, 0);
TextDrawBackgroundColor(Passl10, -1061109505);
TextDrawFont(Passl10, 0);
TextDrawSetSelectable(Passl10, true);

Passl11 = TextDrawCreate(310.000000, 204.113265, "usebox");
TextDrawLetterSize(Passl11, 0.000000, 2.047780);
TextDrawTextSize(Passl11, 269.999969, 0.000000);
TextDrawAlignment(Passl11, 1);
TextDrawColor(Passl11, 529269450);
TextDrawUseBox(Passl11, true);
TextDrawBoxColor(Passl11, 572662218);
TextDrawSetShadow(Passl11, 0);
TextDrawSetOutline(Passl11, 0);
TextDrawBackgroundColor(Passl11, -1061109505);
TextDrawFont(Passl11, 0);
TextDrawSetSelectable(Passl11, true);
and yes codes are in OnGameModeInit , so i want to use it on this command :
Код:
dcmd_showlocktext(playerid,params[])
{
    #pragma unused params
    SelectTextDraw(playerid, 0xA3B4C5FF);
    TextDrawShowForPlayer(playerid, Passl7);
    TextDrawShowForPlayer(playerid, Passl9);
    TextDrawShowForPlayer(playerid, Passl10);
    TextDrawShowForPlayer(playerid, Passl11);
    return 1;
}
and here is onplayerclicktextdraw :
Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
		if(clickedid == Passl7)
		{
 		SendClientMessage(playerid,COLOR_ERROR,"7");
		}else if(clickedid == Passl9)
		{
 		SendClientMessage(playerid,COLOR_ERROR,"9");
 		
		}else if(clickedid == Passl10)
		{
 		SendClientMessage(playerid,COLOR_ERROR,"10");

		}else if(clickedid == Passl11)
		{
 		SendClientMessage(playerid,COLOR_ERROR,"11");

		}
and now when i hover the mouse on it it wont change color and send that message that i typed on OnPlayerClickTextDraw in fact its just a normal textdraw ! can you guys help me ? thnx +rep for helper
Reply
#2

1. TextDrawTextSize(Passl9, 227.600006, 0.000000); 'y' zeroed
2. Can not select Box to be clicked, you should use sprite textdraw.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)