Clickable Textdraw issue
#1

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?
Reply
#2

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?
Reply
#3

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

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.
Reply
#5

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?
Reply
#6

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)
Reply
#7

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
Reply
#8

The problem is your absolute shit bump, sir.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)