SA-MP Forums Archive
Can't select textdraw - 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: Can't select textdraw (/showthread.php?tid=472698)



Can't select textdraw - dusk - 30.10.2013

Hello,

I cannot select a textdraw I created, when I hover the mouse over it, the color changes. But when I click it, OnPlayerClickTextdraw gets called, but action for the textdraw isn't performed.


I create it like this:
pawn Код:
Furniture_Mode[playerid][0] = TextDrawCreate(360.0,372.0,"LD_POOL:ball");
    Furniture_Mode[playerid][1] = TextDrawCreate(360.0,389.0,"LD_POOL:ball");
    for(new i; i < 2; i++)
    {
        TextDrawFont(Furniture_Mode[playerid][i],4);
        TextDrawTextSize(Furniture_Mode[playerid][i],15.0,15.0);
        TextDrawSetSelectable(Furniture_Mode[playerid][i],1);
    }
And OnPlayerClickTextdraw
pawn Код:
if(clickedid == Furniture_Mode[playerid][0])
    {
        printf("it is here");
        SendClientMessage(playerid,RED,"Number 0 is selected");
        set.IsMovingObject[playerid] = true;
        set.IsRotatingObject[playerid] = false;
        TextDrawHideForPlayer(playerid,Furniture_Mode[playerid][0]);
        TextDrawHideForPlayer(playerid,Furniture_Mode[playerid][1]);
        TextDrawColor(Furniture_Mode[playerid][0],0xFF0000FF);
        TextDrawColor(Furniture_Mode[playerid][1],0xFFFFFFFF);
        TextDrawShowForPlayer(playerid,Furniture_Mode[playerid][0]);
        TextDrawShowForPlayer(playerid,Furniture_Mode[playerid][1]);
        return 1;
    }
    if(clickedid == Furniture_Mode[playerid][1])
    {
        SendClientMessage(playerid,RED,"Number 1 is selected");
        set.IsRotatingObject[playerid] = true;
        set.IsMovingObject[playerid] = false;
        TextDrawHideForPlayer(playerid,Furniture_Mode[playerid][0]);
        TextDrawHideForPlayer(playerid,Furniture_Mode[playerid][1]);
        TextDrawColor(Furniture_Mode[playerid][0],0xFFFFFFFF);
        TextDrawColor(Furniture_Mode[playerid][1],0xFF0000FF);
        TextDrawShowForPlayer(playerid,Furniture_Mode[playerid][0]);
        TextDrawShowForPlayer(playerid,Furniture_Mode[playerid][1]);
        return 1;
    }

As you noticed there are two textdraws that are created identically. The weirdest part that the one with index 1 is working just fine.

That part "It is here" never gets printed.


Re: Can't select textdraw - dusk - 31.10.2013

bump


Re: Can't select textdraw - dusk - 01.11.2013

bump, once more.


Re: Can't select textdraw - dusk - 03.11.2013

bump. Still an issue.


Re: Can't select textdraw - dusk - 04.11.2013

A fourth bump, wow. No ideas, really?

Oh and I tried deleting the working one.. Problem didn't delete with it


EDIT: sorry for the early bump... Due to timezone differene it's hard for me to track forums time..


Re: Can't select textdraw - Pottus - 04.11.2013

pawn Код:
for(new i; i < 2; i++)
    {
        TextDrawFont(Furniture_Mode[playerid][i],4);
        TextDrawTextSize(Furniture_Mode[playerid][i],15.0,15.0);
        TextDrawSetSelectable(Furniture_Mode[playerid][i],1);
    }
The clickable areas overlap of course so only the last textdraw would work.


Re: Can't select textdraw - dusk - 04.11.2013

How do you mean?


Re: Can't select textdraw - Pottus - 04.11.2013

TextDrawTextSize(Furniture_Mode[playerid][i],15.0,15.0);


Re: Can't select textdraw - dusk - 04.11.2013

But if I change the TextSize the sizeof the textdraw changes aswell...

What area should set it to anyway?


Re: Can't select textdraw - dusk - 05.11.2013

Okay I guess this is my current question: can I change the clickable are for a txd model without changing it's size?