SA-MP Forums Archive
OnPlayerClickPlayerTextDraw does not fetch data - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP (https://sampforum.blast.hk/forumdisplay.php?fid=3)
+--- Forum: Bug Reports (https://sampforum.blast.hk/forumdisplay.php?fid=20)
+--- Thread: OnPlayerClickPlayerTextDraw does not fetch data (/showthread.php?tid=489867)



OnPlayerClickPlayerTextDraw does not fetch data - BullseyeHawk - 24.01.2014

I've noticed up while I was playing around with the "OnPlayerClickPlayerTextDraw" that it does not catch the data that is outside the function after it was used once.

Example:

pawn Код:
new data[5][5][5];

public OnPlayerClickPlayerTextDraw(...)
{
      new printData = data[3][2][1];
      printf("%d", printData);
}
--

Let's say we have 5 in that memory slot, so it'd print out 5 for the first time, now the second time it clicks on a player textdraw while having the pervious textdraw open as well. Would result in data[3][2][1] returning 0.

I've tested it a couple of times, with PVarInt and without. Same results. new printData does NOT get any data.

--

This bug happens only when:
  1. Player gets a first textdraw that is clickable and clicks it and it opens a new clickable textdraw somewhere else on the screen
  2. When the second click on the second textdraw happens
---

The only fix I have found, is making one integer static for it. And using that integer each time. Nothing can fix that OnPlayerClickPlayerTextDraw does not catch the data he is reciveing from an external 'new'.