new bool:CloseTextDraw[MAX_PLAYERS];
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
// Close code
if(Text:INVALID_TEXT_DRAW == clickedid)
{
if(!CloseTextDraw[playerid]) SelectTextDraw(playerid, 0x00FF00FF);
else
{
HideTextDraws(playerid);
CloseTextDraw[playerid] = false;
}
}
// Close Click
if(Text:Close_Click == clickedid)
{
CloseTextDraw[playerid] = true;
CancelSelectTextDraw(playerid);
}
HideTextDraws(playerid)
{
TextDrawHideForPlayer(playerid, MyDraw);
}
}
|
OnPlayerClickTextDraw gets called with INVALID_TEXT_DRAW. Do note however, OnPlayerClickPLAYERTextDraw is NOT.
|
|
Gangasta: That would be correct.
The difference is one is for player textdraws the other is for standard global textdraws both can be intermixed and even if your only using player textdraws OnPlayerClickTextDraw() will still be called when cancelling your textdraw selection or pressing esc. |
new bool:CloseTextDraw[MAX_PLAYERS];
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
// Close code
if(Text:INVALID_TEXT_DRAW == clickedid)
{
if(!CloseTextDraw[playerid]) SelectTextDraw(playerid, 0x00FF00FF);
else
{
HideTextDraws(playerid);
CloseTextDraw[playerid] = false;
}
}
// Close Click you can remove this
if(Text:Close_Click == clickedid)
{
// These two lines will close the textdraw put them where you need them in your script!
CloseTextDraw[playerid] = true;
CancelSelectTextDraw(playerid);
}
}