SA-MP Forums Archive
Clickable Textdraw issue - 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: Clickable Textdraw issue (/showthread.php?tid=367800)



Clickable Textdraw issue - Oh - 11.08.2012

pawn Код:
Textdraw48                      =TextDrawCreate(86.000000, 425.000000, "Exit Game");
TextDrawAlignment   (Textdraw48, 2);
TextDrawBackgroundColor (Textdraw48, 255);
TextDrawFont                (Textdraw48, 2);
TextDrawLetterSize      (Textdraw48, 0.370000, 1.000000);
TextDrawColor               (Textdraw48, -1);
TextDrawSetOutline      (Textdraw48, 1);
TextDrawSetProportional (Textdraw48, 1);
TextDrawUseBox          (Textdraw48, 1);
TextDrawBoxColor            (Textdraw48, 150);
TextDrawTextSize            (Textdraw48, 320.000000, 79.000000);
TextDrawSetSelectable(Textdraw48, 1);

public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(clickedid != INVALID_TEXT_DRAW)
    {
    if(clickedid == Textdraw48)
    {
        SendClientMessage(playerid, COLOR_RED, "1");
        CancelSelectTextDraw(playerid);
    }
    }
    return 0;
}
----

Tried everything to get it working.. Literally hours and hours and hours and hours and it just won't work. Tried modfiying TextDrawBoxSize, Tried making it selectable before it activates the players mouse, Tried checking if it wasn't equal to Invalid Text Draw before using it.. I could go on for hours. What is wrong with this textdraw?


Re: Clickable Textdraw issue - Oh - 12.08.2012

So I put it in a FS and was able to work there, is there anything that could stop this from working in a GM?


Re: Clickable Textdraw issue - Jarnu - 12.08.2012

pawn Код:
return 0;
shouldn't it be return 1?


Re: Clickable Textdraw issue - [MM]18240[FMB] - 12.08.2012

It should be 0 if at the end of the script, if you are using this in a GM, having the return to 0 will mess everything up.


Re: Clickable Textdraw issue - Oh - 12.08.2012

That has nothing to do with it. I've tried return 1 and 0 because it was suggested in other threads. Regardless this would have nothing to do with it as that is only once its been clicked. The problem is here the textdraws aren't even selectable. When I go to where I highlight them in the FS it works but not in the GM even though its pretty much exactly the same. Only difference is there are multiple selecable textdraws on the screen. I have a keypad system with selectable textdraws that works fine in the GM so why dont these?


Re: Clickable Textdraw issue - Nicholas. - 12.08.2012

This problem is probably coming from your TextSize of your textdraw. The X coordinate of the TextSize should be higher than the X coordinate of the TextDraw.

I tweaked it for you a bit.

pawn Код:
TextDrawTextSize(140.000000, 425.000000)



Re: Clickable Textdraw issue - Hayden_Almeida - 15.12.2015

Quote:
Originally Posted by Oh
Посмотреть сообщение
pawn Код:
Textdraw48                      =TextDrawCreate(86.000000, 425.000000, "Exit Game");
TextDrawAlignment   (Textdraw48, 2);
TextDrawBackgroundColor (Textdraw48, 255);
TextDrawFont                (Textdraw48, 2);
TextDrawLetterSize      (Textdraw48, 0.370000, 1.000000);
TextDrawColor               (Textdraw48, -1);
TextDrawSetOutline      (Textdraw48, 1);
TextDrawSetProportional (Textdraw48, 1);
TextDrawUseBox          (Textdraw48, 1);
TextDrawBoxColor            (Textdraw48, 150);
TextDrawTextSize            (Textdraw48, 320.000000, 79.000000);
TextDrawSetSelectable(Textdraw48, 1);

public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(clickedid != INVALID_TEXT_DRAW)
    {
    if(clickedid == Textdraw48)
    {
        SendClientMessage(playerid, COLOR_RED, "1");
        CancelSelectTextDraw(playerid);
    }
    }
    return 0;
}
----

Tried everything to get it working.. Literally hours and hours and hours and hours and it just won't work. Tried modfiying TextDrawBoxSize, Tried making it selectable before it activates the players mouse, Tried checking if it wasn't equal to Invalid Text Draw before using it.. I could go on for hours. What is wrong with this textdraw?
The problem is the Letter Size:
Код:
TextDrawLetterSize		(Textdraw48, 0.370000, 1.000000);
The AREA of: 0.37 and 1.00 is so Small for Click! You need to increase this for work properly, like: 5.0, 5.0


Re: Clickable Textdraw issue - Ritzy2K - 16.12.2015

The problem is your absolute shit bump, sir.