27.01.2014, 11:43
pawn Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(_:clickedid != INVALID_TEXT_DRAW) // If the player clicked a valid textdraw, continue with the coding. (_:var removes the Text: tag, to avoid tag mismatch)
{
if(clickedid == A)
{
// Do something
}
else if(clickedid == B)
{
// Do something
}
TextDrawHideForPlayer(playerid, A);
TextDrawHideForPlayer(playerid, B);
CancelSelectTextDraw(playerid); // This will indeed call OnPlayerClickTextDraw again, but with an ID of 65535. The code above stops it from resulting in an eternal loop.
}
return 1;
}