Need help with clickable textdraws.. - 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: Need help with clickable textdraws.. (
/showthread.php?tid=430378)
Need help with clickable textdraws.. -
Scrillex - 13.04.2013
So cursor doesn't shows up and I cant click textdraw.......
Code:
pawn Код:
Textdraw9 = TextDrawCreate(91.000000, 237.000000, "1");
TextDrawBackgroundColor(Textdraw9, 255);
TextDrawFont(Textdraw9, 1);
TextDrawLetterSize(Textdraw9, 0.280000, 1.200000);
TextDrawColor(Textdraw9, -1);
TextDrawSetOutline(Textdraw9, 0);
TextDrawSetProportional(Textdraw9, 1);
TextDrawSetShadow(Textdraw9, 1);
TextDrawSetSelectable(Textdraw9, 1);
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_SUBMISSION)
{
TextDrawShowForPlayer(playerid, Textdraw9);
SelectTextDraw(playerid, 0xFF4040AA);
}
return 1;
}
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(clickedid == Textdraw9)
{
SendClientMessage(playerid, 0xFFFFFFAA, "You clicked on a textdraw.");
CancelSelectTextDraw(playerid);
}
return 1;
}
Re: Need help with clickable textdraws.. -
RajatPawar - 13.04.2013
I noticed that for some small textdraws, even on clicking, this callback doesn't get called, try making the textdraw bigger ("1" to "1512612612612") and then click and see if the expect result is achieved. That way you can narrow the problem down.
Re: Need help with clickable textdraws.. -
Scrillex - 13.04.2013
You see I cant click it... at all.. Cursor isn't showing up... It's like in normal game without a cursor..
Re: Need help with clickable textdraws.. -
RajatPawar - 13.04.2013
check the newkeys like:
pawn Код:
if( newkeys & KEY_SUBMISSION)
Re: Need help with clickable textdraws.. -
Pottus - 13.04.2013
TextDrawTextSize() your missing this defines the size of a clickable area.
Re: Need help with clickable textdraws.. -
Scrillex - 13.04.2013
Still cant klick.. You see the mouse cursor is not appiering.. Still... Yeah I thought about that too.. Now I will see if it will work.. But just intresting is that the mouse cursor ain't appiering...
OOkay.. this is interesting.. now when I press fire it appiers it's ok I put textdraws clickable region on
TextDrawTextSize(Textdraw9,60.000000, 20.000000);
Still it cant be clicked!