24.03.2012, 10:57
(
Последний раз редактировалось Hiddos; 24.03.2012 в 12:27.
)
I've got no clue why, but CancelSelectTextDraw calls OnPlayerClickTextDraw (Seriously, what useful information would it pass?).
Code like this:
CancelSelectTextdraw calls OnPlayerClickTextDraw, so using the function in OnPlayerClickTextDraw results in an endless loop.
I did some research and found that CancelSelectTextDraw calls OnPlayerClickTextDraw with a textdraw ID of 65535 - INVALID_TEXT_DRAW. That said: If you want to use CancelSelectTextDraw in OnPlayerClickTextDraw without creating an eternal loop, you'll need to adjust your code to something like this:
I guess they'll fix this in a later RC, but for whomever is already experiencing problems this could be a workaround.
Edit: Small fix
Edit: Tweaked 65535 to INVALID_TEXT_DRAW - thanks to Stepashka
Code like this:
pawn Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
/*
-- other code --
*/
CancelSelectTextDraw(playerid);
}
I did some research and found that CancelSelectTextDraw calls OnPlayerClickTextDraw with a textdraw ID of 65535 - INVALID_TEXT_DRAW. That said: If you want to use CancelSelectTextDraw in OnPlayerClickTextDraw without creating an eternal loop, you'll need to adjust your code to something like this:
pawn Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(_:clickedid != INVALID_TEXT_DRAW)
{
/*
-- other code --
*/
CancelSelectTextDraw(playerid);
}
}
Edit: Small fix
Edit: Tweaked 65535 to INVALID_TEXT_DRAW - thanks to Stepashka