public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(clickedid == JoinArena)
{
if(ArenaStarted == 1)
{
SendClientMessage(playerid, COLOR_RED, "Arena already started. Putting you in queue!");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_YELLOW, "<!>Bla!");
}
return 1;
}
return 1;
}
SelectTextDraw(playerid, 0x00FF00FF); TextDrawShowForPlayer(playerid, JoinArena);
//Top of the script
new Text:JoinArena;
//GameModeInit
JoinArena = TextDrawCreate(430.000000, 369.000000 , "Join Arena");
TextDrawFont(JoinArena , 3);
TextDrawLetterSize(JoinArena , 1, 3);
TextDrawColor(JoinArena , COLOR_RED);
TextDrawSetOutline(JoinArena , false);
TextDrawSetProportional(JoinArena , true);
TextDrawSetShadow(JoinArena , 1);
TextDrawSetSelectable(JoinArena, true);
//GameModeExit
TextDrawDestroy(JoinArena);
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(_:clickedid != INVALID_TEXT_DRAW)
{
if(clickedid == JoinArena)
{
if(ArenaStarted == 1)
{
SendClientMessage(playerid, COLOR_RED, "Arena already started. Putting you in queue!");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_YELLOW, "<!>Bla!");
}
}
return 1;
}
TextDrawHideForPlayer(playerid, JoinArena);
CancelSelectTextDraw(playerid);
return 1;
}
//Under OnPlayerConnect
SelectTextDraw(playerid, 0x00FF00FF);
TextDrawShowForPlayer(playerid, JoinArena);
|
You can control the selectable area of the textdraw using TextDrawTextSize (Read the last note in the wiki page)
|