Textdraw
#1

The problem is that the textdraws dont get selected

Код:
	Textdraw6 = TextDrawCreate(303.555511, 153.813339, "LOGIN");
	TextDrawLetterSize(Textdraw6, 0.449999, 1.600000);
	TextDrawAlignment(Textdraw6, 1);
	TextDrawColor(Textdraw6, -1);
	TextDrawSetShadow(Textdraw6, 0);
	TextDrawSetOutline(Textdraw6, 1);
	TextDrawBackgroundColor(Textdraw6, 51);
	TextDrawFont(Textdraw6, 3);
	TextDrawSetProportional(Textdraw6, 1);
	TextDrawTextSize(Textdraw6, 10.0,10.0);
	TextDrawSetSelectable(Textdraw6, true);

	Textdraw4 = TextDrawCreate(288.888916, 120.960006, "REGISTER");
	TextDrawLetterSize(Textdraw4, 0.449999, 1.600000);
	TextDrawAlignment(Textdraw4, 1);
	TextDrawColor(Textdraw4, -1);
	TextDrawSetShadow(Textdraw4, 0);
	TextDrawSetOutline(Textdraw4, 1);
	TextDrawBackgroundColor(Textdraw4, 51);
	TextDrawFont(Textdraw4, 3);
	TextDrawSetProportional(Textdraw4, 1);
	TextDrawTextSize(Textdraw4, 10.0,10.0);
	TextDrawSetSelectable(Textdraw4, true);
Код:
			TextDrawShowForPlayer(playerid, Textdraw4);
			TextDrawShowForPlayer(playerid, Textdraw6);
			SelectTextDraw(playerid, COLOR_GREY);
Note: I used iTD for the textdraws
Reply
#2

PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
newkeys == KEY_SUBMISSION)
    {
        
TextDrawShowForPlayer(playeridTextdraw4);
    
TextDrawShowForPlayer(playeridTextdraw6);
    
SelectTextDraw(playeridCOLOR_GREY);
    }
    return 
1;
}
 
public 
OnPlayerClickTextDraw(playeridText:clickedid)
{
    if(
clickedid == Textdraw4)
    {
         
SendClientMessage(playerid0xFFFFFFAA"You clicked on a Textdraw4.");
         
CancelSelectTextDraw(playerid);
    }
    else if(
clickedid == Textdraw6)
    {
         
SendClientMessage(playerid0xFFFFFFAA"You clicked on a Textdraw6.");
         
CancelSelectTextDraw(playerid);
    }
    return 
1;

Being REGISTER and LOGIN, you should use PlayerTextDraw...?

Sorry my bad english :c
Reply
#3

I used the same method.
Reply
#4

Use OnPlayerClickTextDraw
Reply
#5

PHP код:
public OnPlayerClickTextDraw(playeridText:clickedid)
{
    if(
clickedid != Text:INVALID_TEXT_DRAW)
    {
       if(
clickedid == textdraw4)
       {
          
//login code
       
}
       if(
clickedid == textdraw6)
       {
          
//register code
       
}
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)