Clickable textdraw doesnt work... - 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: Clickable textdraw doesnt work... (
/showthread.php?tid=466463)
Clickable textdraw doesnt work... -
Scrillex - 27.09.2013
can't click textdraw...
pawn Код:
[B]OnGamemode:[/B]
Textdraw12 = TextDrawCreate(194.400054, 404.693237, "-->");
TextDrawLetterSize(Textdraw12, 0.449999, 1.600000);
TextDrawAlignment(Textdraw12, 1);
TextDrawColor(Textdraw12, 255);
TextDrawSetShadow(Textdraw12, 0);
TextDrawSetOutline(Textdraw12, 1);
TextDrawBackgroundColor(Textdraw12, 51);
TextDrawFont(Textdraw12, 3);
TextDrawSetProportional(Textdraw12, 1);
TextDrawSetSelectable(Textdraw12, true);
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_SUBMISSION)
{
TextDrawShowForPlayer(playerid, Textdraw12);
SelectTextDraw(playerid, 0xFF4040AA);
}
return 1;
}
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(clickedid == Textdraw12)
{
SendClientMessage(playerid, 0xFFFFFFAA, "You clicked on a textdraw.");
CancelSelectTextDraw(playerid);
}
return 1;
}
Re: Clickable textdraw doesnt work... -
Pottus - 27.09.2013
Most common error with clickable textdraw is.....
TextDrawSetTextSize() which you are missing.
Now the values might be slightly confusing the X indicates the start position of the clickable area on the X-axis the Y-Position indicates the height of the clickable area not the position.
Re: Clickable textdraw doesnt work... -
Scrillex - 27.09.2013
Hmmh I used iPLEOMAXs TextDraw Editor fs.. idk which one to use then... I want to make everything run as good as possible.. Just I dont know where to get those x y coords..
Btw isn't it TextDrawLetterSize? the same?
Re: Clickable textdraw doesnt work... -
Pottus - 28.09.2013
No it's not... Just set the X coord to that of your create position then y to the height you want of the clickable areas.
Side note: I won't use that textdraw editor because of this TextDrawCreate(194.400054, 404.693237, "-->");
You want to use whole values otherwise you'll have troubles with different resolutions when you got a bunch of TD's.