SA-MP Forums Archive
About OnPlayerClickPlayerTextDraw calls - 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: About OnPlayerClickPlayerTextDraw calls (/showthread.php?tid=328195)



About OnPlayerClickPlayerTextDraw calls - CyNiC - 24.03.2012

Well, I made a system which contains menus with textdraws, when it was written using global textdraws, the callback OnPlayerClickTextDraw was called when the the server canceled him textdraw selection.

With per player textdraws it doesn't happens as it should, I need to know when the players leave the selectable mode by all ways possible.

My english is bad, then what I'm trying to say is: OnPlayerClickPlayerTextDraw isn't called when the server cancel your textdraw selection.


Re: About OnPlayerClickPlayerTextDraw calls - SpiritEvil - 24.03.2012

Yes, OnPlayerClickTextDraw is called when he cancels the textdraw selection.


Re: About OnPlayerClickPlayerTextDraw calls - CyNiC - 06.04.2012

By pressing Esc while selecting global textdraw the callback OnPlayerCLlickTextDraw is called holding an invalid text draw id(65535), but if you press Esc while selecting per-player textdraw the callback OnPlayerClickPlayerTextDraw is not called.


Re: About OnPlayerClickPlayerTextDraw calls - Hiddos - 06.04.2012

When 'stopping' to select a textdraw of any kind - normal or player - OnPlayeClickTextDraw gets called (Not OnPlayerClickPlayerTextDraw) with INVALID_TEXT_ID


Re: About OnPlayerClickPlayerTextDraw calls - CyNiC - 06.04.2012

Thanks for the info but it's stranger, everyone expects that it's being called by OnPlayerClickPlayerTextDraw.


Re: About OnPlayerClickPlayerTextDraw calls - Hiddos - 06.04.2012

No, why would it?

If you're making a player select a textdraw, players can either click on player textdraws or normal textdraws, guaranteed they are selectable. SelectTextDraw is the only function, there is no SelectPlayerTextDraw or whatever.


Re: About OnPlayerClickPlayerTextDraw calls - Whitetiger - 07.04.2012

why not make it call both callbacks .... ?


Re: About OnPlayerClickPlayerTextDraw calls - Hiddos - 07.04.2012

Quote:
Originally Posted by whitetigerswt
Посмотреть сообщение
why not make it call both callbacks .... ?
Well you could just do:
pawn Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
  if(_:clickedid == INVALID_TEXT_DRAW) return CallLocalFunction("OnPlayerClickPlayerTextDraw", "ii", playerid, INVALID_TEXT_DRAW);
  return 1;
}