29.01.2013, 21:16
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 == nome1)
{
new exemplo1[600];
format(exemplo1,sizeof(exemplo1),"\nEscreva Aqui algo");
ShowPlayerDialog(playerid,31,DIALOG_STYLE_MSGBOX,"Exemplo 1",exemplo1,"Ok","");
}
else if(clickedid == nome2)
{
new exemplo2[600];
format(exemplo2,sizeof(exemplo2),"\nEscreva Aqui algo");
ShowPlayerDialog(playerid,32,DIALOG_STYLE_MSGBOX,"Exemplo 2",exemplo2,"Ok","");
}
else if(clickedid == nome3)
{
new exemplo3[600];
format(exemplo3,sizeof(exemplo3),"\nEscreva Aqui algo");
ShowPlayerDialog(playerid,33,DIALOG_STYLE_MSGBOX,"Exemplo 3",exemplo3,"Ok","");
}
TextDrawHideForPlayer(playerid, nome1);
TextDrawHideForPlayer(playerid, nome2);
TextDrawHideForPlayer(playerid, nome3);
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;
}

