Textdraw not doing anything
#1

Okay well I made this simple system, but it wont work. Whenever you click the textdraw, nothing happens. Any suggestions?

Код:
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;
}
Everything works good until you click it. It wont work when you click it. It's setted as selectable but it doesnt do anything. It wont show that SendClientMessage

Also yeah
Код:
SelectTextDraw(playerid, 0x00FF00FF);
	TextDrawShowForPlayer(playerid, JoinArena);
Reply
#2

You might re-read this tutorial.
Reply
#3

I've read that tutorial, and I dont see any difference to be honest.

Here is my current entire code.


Код:
//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);
Reply
#4

You can control the selectable area of the textdraw using TextDrawTextSize (Read the last note in the wiki page)
Reply
#5

Quote:
Originally Posted by DaRk_RaiN
Посмотреть сообщение
You can control the selectable area of the textdraw using TextDrawTextSize (Read the last note in the wiki page)
Tried with that too.
TextDrawTextSize(JoinArena, 430.000000, 369.000000);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)