SA-MP Forums Archive
OnPlayerClickTextDraw problem - 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: OnPlayerClickTextDraw problem (/showthread.php?tid=364726)



OnPlayerClickTextDraw problem - lewismichaelbbc - 31.07.2012

Код:
// top of script: 

new Text:ClassCreateButton[MAX_PLAYERS];

// OnPlayerSpawn:

        SelectTextDraw(playerid, COLOR_RED);

	ClassCreateButton[playerid] = TextDrawCreate(256.000000, 341.000000, "Create Character");
	TextDrawBackgroundColor(ClassCreateButton[playerid], 255);
	TextDrawFont(ClassCreateButton[playerid], 1);
	TextDrawLetterSize(ClassCreateButton[playerid], 0.500000, 1.000000);
	TextDrawColor(ClassCreateButton[playerid], -65281);
	TextDrawSetOutline(ClassCreateButton[playerid], 0);
	TextDrawSetProportional(ClassCreateButton[playerid], 1);
	TextDrawSetShadow(ClassCreateButton[playerid], 1);
	TextDrawUseBox(ClassCreateButton[playerid], 1);
	TextDrawBoxColor(ClassCreateButton[playerid], 255);
	TextDrawTextSize(ClassCreateButton[playerid], 394.000000, 0.000000);
	TextDrawSetSelectable(ClassCreateButton[playerid], 1);

        TextDrawShowForPlayer(playerid, ClassCreateButton[playerid]);

// 

public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
	if(clickedid == ClassCreateButton[playerid])
	{
	    SaveClassSelection(playerid);
 	}
	return 0;
}
This is my code. It compiles perfectly, it all shows up in game... my mouse appears so that i can click on it. But when I click it, it does nothing... it doesnt even change colour when I hover my mouse over it... how can i fix this?

Thanks


Respuesta: OnPlayerClickTextDraw problem - lewismichaelbbc - 31.07.2012

can anyone help me? please :P


Re: OnPlayerClickTextDraw problem - MaDK1LLA - 31.07.2012

Код:
 public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
	if(clickedid == ClassCreateButton[playerid])
	{
	    SaveClassSelection(playerid);
 	}
	return 0;
}
This executes when you click on the textdraw?
What are you trying to accomplish with your on click?


Re: OnPlayerClickTextDraw problem - telmo_ferreira - 31.07.2012

change
TextDrawTextSize(ClassCreateButton[playerid], 394.000000, 0.000000);

to

TextDrawTextSize(ClassCreateButton[playerid], 394.000000, 20.000000);
or
TextDrawTextSize(ClassCreateButton[playerid], 394.000000, 25.000000);

the size u need