SA-MP Forums Archive
How to detect if player didn't select any textdraw. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to detect if player didn't select any textdraw. (/showthread.php?tid=431650)



How to detect if player didn't select any textdraw. - Helia - 19.04.2013

I know about OnPlayerClickPlayerTextDraw but what if player press `Esc` and cancel the selection ?

Is there any callback like OnPlayerCancelPlayerTextDraw ?


Re : How to detect if player didn't select any textdraw. - HitnKill - 19.04.2013

PHP Code:
public OnPlayerClickTextDraw(playeridText:clickedid)
{
  if(
clickedid == Text:INVALID_TEXT_DRAW)
  {
        
// your code
  
}
  return 
1;

And if you use OnPlayerClickPlayerTextDraw you detect ESC with OnPlayerClickTextDraw.

ps: never use CancelSelectTextDraw when the player ESC on select textdraw.


Re: How to detect if player didn't select any textdraw. - Helia - 19.04.2013

Quote:
Originally Posted by ******
View Post
Have you thought about trying to read the documentation on the wiki?

https://sampwiki.blast.hk/wiki/OnPlayerClickTextDraw
OnPlayerClickPlayerTextDraw is NOT called when selection is cancelled.
However OnPlayerClickTextDraw works fine.
And no. I won't bother to read that ugly SA:MP wiki while I can simply ask here so someone else can provide me the solution.