SA-MP Forums Archive
OnPlayerClickTextDraw ... - 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: OnPlayerClickTextDraw ... (/showthread.php?tid=333393)



OnPlayerClickTextDraw ... - WaLLy.SAMP - 11.04.2012

I have a textdraw selectable..i click on textdraw and.. nothing happens

pawn Код:
TextDraw = TextDrawCreate(10.000000, 141.000000, "Press Here!");
    TextDrawTextSize(TextDraw,60.000000, 20.000000);
    TextDrawAlignment(TextDraw,0);
    TextDrawBackgroundColor(TextDraw,0x000000ff);
    TextDrawFont(TextDraw,1);
    TextDrawLetterSize(TextDraw,0.250000, 1.000000);
    TextDrawColor(TextDraw,0xffffffff);
    TextDrawSetProportional(TextDraw,1);
    TextDrawSetShadow(TextDraw,1);
    TextDrawSetSelectable(TextDraw, 1);

CMD:
if(strcmp(cmdtext, "/test", true) == 0)
{
    TextDrawShowForPlayer(playerid,TextDraw);
    SelectTextDraw(playerid, 0xFF4040AA);
    return 1;
}

public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(clickedid == TextDraw)
    {
         SetPlayerPos(playerid, 1529.6,-1691.2,13.3);
         SendClientMessage(playerid, 0xFFFFFFAA, "You clicked on a textdraw.");
         CancelSelectTextDraw(playerid);
    }
    return 1;
}



AW: OnPlayerClickTextDraw ... - Meta - 11.04.2012

Does the Textcolor change when you hover it?
Please note that the clickable area moves if you play in windowmode.


Re: OnPlayerClickTextDraw ... - WaLLy.SAMP - 11.04.2012

Yes,color is changed.


Re: OnPlayerClickTextDraw ... - IstuntmanI - 11.04.2012

Use return 0; in GM, at the end of OnPlayerClickTextDraw callback, same on FS.


Re: OnPlayerClickTextDraw ... - WaLLy.SAMP - 11.04.2012

Done..thanks solv