SA-MP Forums Archive
TextDraw isn't clickable - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: TextDraw isn't clickable (/showthread.php?tid=456302)



TextDraw isn't clickable - Shawwarma - 05.08.2013

Код:
   
new Text:LeftArrow;
new Text:RightArrow;

    LeftArrow = TextDrawCreate(50.000000, 450.000000, "<<<<");
    TextDrawTextSize(LeftArrow,60.000000, 20.000000);
    TextDrawAlignment(LeftArrow,0);
    TextDrawBackgroundColor(LeftArrow,0x000000ff);
    TextDrawFont(LeftArrow,1);
    TextDrawLetterSize(LeftArrow,0.250000, 1.000000);
    TextDrawColor(LeftArrow,0xffffffff);
    TextDrawSetProportional(LeftArrow,1);
    TextDrawSetShadow(LeftArrow,1);

    RightArrow = TextDrawCreate(550.000000, 450.000000, ">>>>");
    TextDrawTextSize(RightArrow,60.000000, 20.000000);
    TextDrawAlignment(RightArrow,0);
    TextDrawBackgroundColor(RightArrow,0x000000ff);
    TextDrawFont(RightArrow,1);
    TextDrawLetterSize(RightArrow,0.250000, 1.000000);
    TextDrawColor(RightArrow,0xffffffff);
    TextDrawSetProportional(RightArrow,1);
    TextDrawSetShadow(RightArrow,1);

    TextDrawSetSelectable(RightArrow, 1);
    TextDrawSetSelectable(LeftArrow, 1);
This is my code
only LeftArrow works
Why?


Re: TextDraw isn't clickable - McLuhan - 05.08.2013

Replace

PHP код:
    LeftArrow TextDrawCreate(50.000000450.000000"<<<<");
    
TextDrawTextSize(LeftArrow,60.00000020.000000);
    
TextDrawAlignment(LeftArrow,0);
    
TextDrawBackgroundColor(LeftArrow,0x000000ff);
    
TextDrawFont(LeftArrow,1);
    
TextDrawLetterSize(LeftArrow,60.00000013.0);
    
TextDrawColor(LeftArrow,0xffffffff);
    
TextDrawSetProportional(LeftArrow,1);
    
TextDrawSetShadow(LeftArrow,1);
    
RightArrow TextDrawCreate(550.000000450.000000">>>>");
    
TextDrawTextSize(RightArrow,60.00000020.000000);
    
TextDrawAlignment(RightArrow,0);
    
TextDrawBackgroundColor(RightArrow,0x000000ff);
    
TextDrawFont(RightArrow,1);
    
TextDrawLetterSize(RightArrow,550.00000013.0);
    
TextDrawColor(RightArrow,0xffffffff);
    
TextDrawSetProportional(RightArrow,1);
    
TextDrawSetShadow(RightArrow,1); 



Re: TextDraw isn't clickable - morocco - 05.08.2013

From SA-MP wiki

EX:
pawn Код:
new Text:gTextDraw;
 
public OnGameModeInit()
{
    gTextDraw = TextDrawCreate(10.000000, 141.000000, "MyTextDraw");      
    TextDrawTextSize(gTextDraw,60.000000, 20.000000);
    TextDrawAlignment(gTextDraw,0);
    TextDrawBackgroundColor(gTextDraw,0x000000ff);
    TextDrawFont(gTextDraw,1);
    TextDrawLetterSize(gTextDraw,0.250000, 1.000000);
    TextDrawColor(gTextDraw,0xffffffff);
    TextDrawSetProportional(gTextDraw,1);
    TextDrawSetShadow(gTextDraw,1);
    TextDrawSetSelectable(gTextDraw, 1);
    return 1;
}
 
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys == KEY_SUBMISSION)
    {
        TextDrawShowForPlayer(playerid, gTextDraw);
        SelectTextDraw(playerid, 0xFF4040AA);
    }
    return 1;
}
 
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(clickedid == gTextDraw)
    {
         SendClientMessage(playerid, 0xFFFFFFAA, "You clicked on a textdraw.");
         CancelSelectTextDraw(playerid);
    }
    return 1;
}



Re: TextDraw isn't clickable - Shawwarma - 05.08.2013

Quote:
Originally Posted by McLuhan
Посмотреть сообщение
Replace

PHP код:
    LeftArrow TextDrawCreate(50.000000450.000000"<<<<");
    
TextDrawTextSize(LeftArrow,60.00000020.000000);
    
TextDrawAlignment(LeftArrow,0);
    
TextDrawBackgroundColor(LeftArrow,0x000000ff);
    
TextDrawFont(LeftArrow,1);
    
TextDrawLetterSize(LeftArrow,60.00000013.0);
    
TextDrawColor(LeftArrow,0xffffffff);
    
TextDrawSetProportional(LeftArrow,1);
    
TextDrawSetShadow(LeftArrow,1);
    
RightArrow TextDrawCreate(550.000000450.000000">>>>");
    
TextDrawTextSize(RightArrow,60.00000020.000000);
    
TextDrawAlignment(RightArrow,0);
    
TextDrawBackgroundColor(RightArrow,0x000000ff);
    
TextDrawFont(RightArrow,1);
    
TextDrawLetterSize(RightArrow,550.00000013.0);
    
TextDrawColor(RightArrow,0xffffffff);
    
TextDrawSetProportional(RightArrow,1);
    
TextDrawSetShadow(RightArrow,1); 
Still not work...

Quote:
Originally Posted by morocco
Посмотреть сообщение
From SA-MP wiki

EX:
pawn Код:
new Text:gTextDraw;
 
public OnGameModeInit()
{
    gTextDraw = TextDrawCreate(10.000000, 141.000000, "MyTextDraw");      
    TextDrawTextSize(gTextDraw,60.000000, 20.000000);
    TextDrawAlignment(gTextDraw,0);
    TextDrawBackgroundColor(gTextDraw,0x000000ff);
    TextDrawFont(gTextDraw,1);
    TextDrawLetterSize(gTextDraw,0.250000, 1.000000);
    TextDrawColor(gTextDraw,0xffffffff);
    TextDrawSetProportional(gTextDraw,1);
    TextDrawSetShadow(gTextDraw,1);
    TextDrawSetSelectable(gTextDraw, 1);
    return 1;
}
 
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys == KEY_SUBMISSION)
    {
        TextDrawShowForPlayer(playerid, gTextDraw);
        SelectTextDraw(playerid, 0xFF4040AA);
    }
    return 1;
}
 
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(clickedid == gTextDraw)
    {
         SendClientMessage(playerid, 0xFFFFFFAA, "You clicked on a textdraw.");
         CancelSelectTextDraw(playerid);
    }
    return 1;
}
My code based on this code...