PlayerTextDrawSetSelectable Issue
#1

Hi, I use this code and that for clicking textdraws but it's giving off false data:

Код:
for(new k = 0; k < MAX_ROWS; k++)
{
    Position = rc + (k * 9);

    bxOptions[playerid][k] = CreatePlayerTextDraw(playerid, 14.000000, Position, " ");
    PlayerTextDrawBackgroundColor(playerid, bxOptions[playerid][k], 255);
    PlayerTextDrawFont(playerid, bxOptions[playerid][k], 1);
    PlayerTextDrawLetterSize(playerid, bxOptions[playerid][k], 0.23, 0.93);
    PlayerTextDrawColor(playerid, bxOptions[playerid][k], -1);
    PlayerTextDrawSetOutline(playerid, bxOptions[playerid][k], 1);
    PlayerTextDrawSetProportional(playerid, bxOptions[playerid][k], 1);
    PlayerTextDrawSetSelectable(playerid, bxOptions[playerid][k], 1);
}

public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
    if(playertextid != INVALID_TEXT_DRAW_PLAYER)
    {
        for(new k = 0; k < MAX_ROWS; k++)
        {
	    if(playertextid == bxOptions[playerid][k])
	    {
	         if(k-1 <= 0) continue;

	        format(msg, 5, "%d", k-1);
       		CallRemoteFunction("OnPlayerText", "is", playerid, msg);
       	        break;
	    }
        }
    }
    return 1;
}
[ame]http://www.youtube.com/watch?v=cR7YYvdxLQg[/ame]

All of the other numbers work apart from option 5, water. When I click water it calls donut but all the others are fine.
Reply
#2

Try to change your TextDrawTextSize

pawn Код:
TextDrawTextSize(bxOptions[playerid][k], 30.0, 10.0);

// Clickable area
// 30.0 = Horizontal
// 10.0 = Vertical
Reply
#3

I have updated the main post: Please re-read as I've changed it also video is different.
Reply
#4

The problem is only with the option 5 ?
Reply
#5

If I click option 5 or 6 it returns option 4. But all the other options 1 - 4 work.



Reply
#6

MAX_ROWS = 6 ?
Reply
#7

Quote:
Originally Posted by Viniborn
Посмотреть сообщение
MAX_ROWS = 6 ?
If it was not 6, the textdraw should not display the 6, so I think that's not the problem...
Reply
#8

The clickable areas are fucked up on different resolutions. Really needs fixing..
Reply
#9

Quote:
Originally Posted by MP2
Посмотреть сообщение
The clickable areas are fucked up on different resolutions. Really needs fixing..
Is there no way to fix it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)