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=402091)



OnPlayerClickTextDraw - NoaM[W] - 25.12.2012

OnGameModeInit
Код:
    Textdraw0 = TextDrawCreate(560.000000, 130.000000, ".");
    TextDrawBackgroundColor(Textdraw0, 255);
    TextDrawFont(Textdraw0, 1);
    TextDrawLetterSize(Textdraw0, 1.800000, 23.000000);
    TextDrawColor(Textdraw0, -1);
    TextDrawSetOutline(Textdraw0, 0);
    TextDrawSetProportional(Textdraw0, 1);
    TextDrawSetShadow(Textdraw0, 1);
    TextDrawUseBox(Textdraw0, 1);
    TextDrawBoxColor(Textdraw0, 255);
    TextDrawTextSize(Textdraw0, 440.000000, -10.000000);
    TextDrawSetSelectable(Textdraw0, 1);
OnPlayerConnect
Код:
TextDrawShowForPlayer(playerid, Textdraw0);
Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(clickedid == Textdraw0)
    {
         SendClientMessage(playerid, 0xFFFFFFAA, "You clicked on a textdraw.");
        CancelSelectTextDraw(playerid);
    }
    return 1;
}
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys == KEY_SUBMISSION)
    {
        SelectTextDraw(playerid, 0xFF4040AA);
    }
    return 1;
}
It show me the TextDraw but i cant to click him...


Re: OnPlayerClickTextDraw - DaRk_RaiN - 25.12.2012

Again, if the textdraw is just a box(empty), it can't be clicked, you should try to add a text above the box.
Btw make sure the Key is valid.


Re : OnPlayerClickTextDraw - NoaM[W] - 25.12.2012

Have the box, and near the box have a text - "."


Re : OnPlayerClickTextDraw - NoaM[W] - 25.12.2012

up!!!


Re: OnPlayerClickTextDraw - DaRk_RaiN - 25.12.2012

That won't be enough, just make an other textdraw above the Box which will be clickable.