OnPlayerClickPlayerTextDraw Not getting called..
#1

pawn Код:
new PlayerText:Textdraw0[MAX_PLAYERS];
new PlayerText:Textdraw1[MAX_PLAYERS];
pawn Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
        Textdraw0[playerid] = CreatePlayerTextDraw(playerid, 277.021942, 161.333343, "usebox");
    PlayerTextDrawLetterSize(playerid, Textdraw0[playerid], 0.000000, 2.729628);
    PlayerTextDrawTextSize(playerid, Textdraw0[playerid], 240.694000, 0.000000);
    PlayerTextDrawAlignment(playerid, Textdraw0[playerid], 1);
    PlayerTextDrawColor(playerid, Textdraw0[playerid], 0);
    PlayerTextDrawUseBox(playerid, Textdraw0[playerid], true);
    PlayerTextDrawBoxColor(playerid, Textdraw0[playerid], -256);
    PlayerTextDrawSetShadow(playerid, Textdraw0[playerid], 0);
    PlayerTextDrawSetOutline(playerid, Textdraw0[playerid], 0);
    PlayerTextDrawBackgroundColor(playerid, Textdraw0[playerid], -256);
    PlayerTextDrawFont(playerid, Textdraw0[playerid], 0);

    Textdraw1[playerid] = CreatePlayerTextDraw(playerid, 396.494873, 161.333343, "usebox");
    PlayerTextDrawLetterSize(playerid, Textdraw1[playerid], 0.000000, 3.053700);
    PlayerTextDrawTextSize(playerid, Textdraw1[playerid], 356.418731, 0.000000);
    PlayerTextDrawAlignment(playerid, Textdraw1[playerid], 1);
    PlayerTextDrawColor(playerid, Textdraw1[playerid], 0);
    PlayerTextDrawUseBox(playerid, Textdraw1[playerid], true);
    PlayerTextDrawBoxColor(playerid, Textdraw1[playerid], -256);
    PlayerTextDrawSetShadow(playerid, Textdraw1[playerid], 0);
    PlayerTextDrawSetOutline(playerid, Textdraw1[playerid], 0);
    PlayerTextDrawFont(playerid, Textdraw1[playerid], 0);
    print("TD CREATED");
    PlayerTextDrawShow(playerid, Textdraw0[playerid]);
    PlayerTextDrawShow(playerid, Textdraw1[playerid]);
    SendClientMessage(playerid, COLOR_GREEN, "TDs shown..");
    new stz[128];
    format(stz,128,"%d, %d.",Likes[clickedplayerid],Dislikes[clickedplayerid]);
    SendClientMessage(playerid, COLOR_GREY, stz);
    return 1;
}

public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
    print("Test callback");
    if(playertextid == Textdraw0[playerid])
    {
        SendClientMessage(playerid, COLOR_GREEN, "Thanks bla!");
        Test[d]++;
      //  PlayerTextDrawHide(playerid, Textdraw0[playerid]);
      //  PlayerTextDrawHide(playerid, Textdraw1[playerid]);
      print("Test 2");
    }
    if(playertextid == Textdraw1[playerid])
    {
       SendClientMessage(playerid, COLOR_GREEN, "Thanks bla!");
       Test1[d]++;
       PlayerTextDrawHide(playerid, Textdraw0[playerid]);
       PlayerTextDrawHide(playerid, Textdraw1[playerid]);
       print("Test 1");
    }
    return 1;
}
When I click the textdraw, the 'Thanks for bla bla' doesn't get sent. Nothing prints out. Only the 'TD CREATED" line is being printed.
Please do help. I am a bit frustrated.
Reply
#2

Need this, thanks, bump.
Reply
#3

1. PlayerTextDrawTextSize 'Y' can't be 0. You have to set this manually. Trial and error.
2. You need to use PlayerTextDrawSetSelectable and SelectTextdraw.
3. Name your variables better than 'Textdraw0'. When you come back to that in 5 months, you'll be wondering 'what the fuck is Textdraw1?'.
Reply
#4

1. I use ITD and never had a problem like this before.
2. I did, but to no use.
3. Yeah, lol.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)