Textdraw ESC problem
#1

If player press ESC while using selectable TD mouse dissapears. So I do this...

Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{

    if(Text:INVALID_TEXT_DRAW == clickedid)
	{
	SelectTextDraw(playerid, 0x9999BBBB);
	}

	return 1;
}
But when player chooses textdraw and I want to cancel selection it still gives me selection mouse... How do I fix that?
Reply
#2

You can do only one:
1) You can't cancel the selection and must select anything
or
2) You can cancel the selection and doesn't need to select anything
Reply
#3

Ok another problem.

This function
Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(Text:INVALID_TEXT_DRAW == clickedid)
	{
	}

	return 1;
}
Gets called whenever I select any selectable textdraw. I want it be called only when I press ESC.
Reply
#4

Bump
Reply
#5

P.s. I select player textdraw, not global.
Reply
#6

bump
Reply
#7

https://sampwiki.blast.hk/wiki/OnPlayerClickTextDraw

When you choose a textdraw, use CancelSelectTextDraw to remove the selection mouse.

Example:
pawn Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(clickedid == Text:INVALID_TEXT_DRAW) SelectTextDraw(playerid, 0x9999BBBB);
    else
    {
        //if(clickedid == mytextdraw) {
        CancelSelectTextDraw(playerid);
    }
    return 1;
}
https://sampwiki.blast.hk/wiki/CancelSelectTextDraw
Reply
#8

Quote:
Originally Posted by Threshold
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/OnPlayerClickTextDraw

When you choose a textdraw, use CancelSelectTextDraw to remove the selection mouse.

Example:
pawn Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(clickedid == Text:INVALID_TEXT_DRAW) SelectTextDraw(playerid, 0x9999BBBB);
    else
    {
        //if(clickedid == mytextdraw) {
        CancelSelectTextDraw(playerid);
    }
    return 1;
}
https://sampwiki.blast.hk/wiki/CancelSelectTextDraw
Problem is, that this is for global textdraws. I want to make it to Player Textdraws
Reply
#9

This i think
https://sampwiki.blast.hk/wiki/OnPlayerClickPlayerTextDraw
Reply
#10

Hello!

If you press ESC the callback OnPlayerClickTextDraw is calling with the INVALID_TEXT_DRAW.
It does not matter whether they are normal TextDraws or PlayerTextDraws, both called OnPlayerClickTextDraw if you press ESC.

Mencent
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)