OnPlayerClickTextDraw malfunctioning
#1

I'm trying to create 2 buttons with textdraws but it seems like I'm unable to click them. I got everything set up like it's supposed to but somehow I can't seem to click them.

I created my textdraws correctly;

pawn Код:
// On top of script
    enum some_enum {
        Text:TD_gametype,
        Text:TD_leftbutton,
        Text:TD_rightbutton,
        Text:TD_bottomline,
        Text:TD_topline,
        Text:TD_leftline,
        Text:TD_rightline,
    };
    new GT[MAX_PLAYERS][some_enum];
   

    // Under ongamemodeinit (this works)
    GT[playerid][TD_leftbutton] = TextDrawCreate(204.000000, 365.000000, "<");
    TextDrawAlignment(GT[playerid][TD_leftbutton], 2);
    TextDrawBackgroundColor(GT[playerid][TD_leftbutton], 255);
    TextDrawFont(GT[playerid][TD_leftbutton], 1);
    TextDrawLetterSize(GT[playerid][TD_leftbutton], 0.469999, 3.699998);
    TextDrawColor(GT[playerid][TD_leftbutton], -1);
    TextDrawSetOutline(GT[playerid][TD_leftbutton], 1);
    TextDrawSetProportional(GT[playerid][TD_leftbutton], 1);
    TextDrawUseBox(GT[playerid][TD_leftbutton], 1);
    TextDrawBoxColor(GT[playerid][TD_leftbutton], 255);
    TextDrawTextSize(GT[playerid][TD_leftbutton], 0.000000, 34.000000);
    TextDrawSetSelectable(GT[playerid][TD_leftbutton], 1);

    GT[playerid][TD_rightbutton] = TextDrawCreate(434.000000, 365.000000, ">");
    TextDrawAlignment(GT[playerid][TD_rightbutton], 2);
    TextDrawBackgroundColor(GT[playerid][TD_rightbutton], 255);
    TextDrawFont(GT[playerid][TD_rightbutton], 1);
    TextDrawLetterSize(GT[playerid][TD_rightbutton], 0.469999, 3.699998);
    TextDrawColor(GT[playerid][TD_rightbutton], -1);
    TextDrawSetOutline(GT[playerid][TD_rightbutton], 1);
    TextDrawSetProportional(GT[playerid][TD_rightbutton], 1);
    TextDrawUseBox(GT[playerid][TD_rightbutton], 1);
    TextDrawBoxColor(GT[playerid][TD_rightbutton], 255);
    TextDrawTextSize(GT[playerid][TD_rightbutton], 0.000000, 34.000000);
    TextDrawSetSelectable(GT[playerid][TD_rightbutton], 1);
AS you can see I did set "TextDrawSetSelectable" to "1". I also enable "SelectTextDraw(playerid, color)" The following callback gets called when I press exit (so I assume thats working) but it won't work for either of my textdraws.

pawn Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid) {
        // This DOES get called when I press exit (as it's supposed to)
        if(clickedid == GT[playerid][TD_leftbutton]) {
            // This isnt working
        }
        else if(clickedid == GT[playerid][TD_rightbutton]) {
            // this isnt working either
        }
    }
Could anyone see what I'm doing wrong?
Reply


Messages In This Thread
OnPlayerClickTextDraw malfunctioning - by Sinner - 08.08.2012, 18:29
Re: OnPlayerClickTextDraw malfunctioning - by Dragony92 - 08.08.2012, 18:34
Re: OnPlayerClickTextDraw malfunctioning - by Sinner - 08.08.2012, 18:36
Re: OnPlayerClickTextDraw malfunctioning - by Nicholas. - 08.08.2012, 18:37
Re: OnPlayerClickTextDraw malfunctioning - by Sinner - 08.08.2012, 19:26
Re: OnPlayerClickTextDraw malfunctioning - by Nicholas. - 08.08.2012, 19:35
Re: OnPlayerClickTextDraw malfunctioning - by Sinner - 09.08.2012, 15:01

Forum Jump:


Users browsing this thread: 1 Guest(s)