Player textdraw problem
#1

Hi,
I haven't be able to detect when the escape key was pressed also with this code that I've find in this forum:

Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid) 
{ 
     if(_:clickedid == INVALID_TEXT_DRAW)
     {
        //Do stuff
     }
     return 1;
}
I used playertextdraw not normal textdraw.

Thanks in advance
Reply
#2

Код HTML:
public OnPlayerClickPlayerTextDraw(playerid, PlayerText: playertextid)
{
	if(playertextid == PlayerText: INVALID_TEXT_DRAW)
	{
		//do
	}
	
	return 1;
}
Reply
#3

Removed.
Reply
#4

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
Removed.
What?
Reply
#5

Quote:
Originally Posted by Feynman
Посмотреть сообщение
Код HTML:
public OnPlayerClickPlayerTextDraw(playerid, PlayerText: playertextid)
{
	if(playertextid == PlayerText: INVALID_TEXT_DRAW)
	{
		//do
	}
	
	return 1;
}
Also OnPlayerClickPlayerTextDraw isn't called, I just tried
Reply
#6

What you posted should work fine, OnPlayerClickTextDraw is called with clickedid being 65535 (0xFFFF aka INVALID_TEXT_DRAW) if the player presses ESC (any TextDraw Selection, thus it doesn't matter if PlayerTextDraws or regular TextDraws are shown).

So the problem must be somewhere else. Make sure other scripts return 0 in this callback (especially when there are checks for ESC, people falsely return 1 often).
Reply
#7

Quote:
Originally Posted by NaS
Посмотреть сообщение
What you posted should work fine, OnPlayerClickTextDraw is called with clickedid being 65535 (0xFFFF aka INVALID_TEXT_DRAW) if the player presses ESC (any TextDraw Selection, thus it doesn't matter if PlayerTextDraws or regular TextDraws are shown).


So the problem must be somewhere else. Make sure other scripts return 0 in this callback (especially when there are checks for ESC, people falsely return 1 often).
Problem is that the event isn't even called
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)