SA-MP Forums Archive
Textdraw not doing anything - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Textdraw not doing anything (/showthread.php?tid=427521)



Textdraw not doing anything - Pawnie - 02.04.2013

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);



Re: Textdraw not doing anything - Kurzalewski - 02.04.2013

You might re-read this tutorial.


Re: Textdraw not doing anything - Pawnie - 02.04.2013

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);



Re : Textdraw not doing anything - DaRk_RaiN - 02.04.2013

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


Re: Re : Textdraw not doing anything - Pawnie - 02.04.2013

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);