TextDrawClickable doesn't 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: TextDrawClickable doesn't work.. (
/showthread.php?tid=393258)
TextDrawClickable doesn't work.. -
mafiatoss - 17.11.2012
Hi !
I have try to create a textdraw clickable but i have a problems.. I can't click on the textdraw with the textdraw mouse when i go on the textdraw : no hover, and when i click it's don't work ...
Code :
Код:
Textdraw0[playerid] = CreatePlayerTextDraw(playerid, 668.399658, 2.246673, "usebox");
PlayerTextDrawTextSize(playerid,Textdraw0[playerid], 485.200073, 0.000000);
//PlayerTextDrawTextSize(playerid, Textdraw0[playerid], 485.200073, 0.000000);
PlayerTextDrawAlignment(playerid, Textdraw0[playerid], 1);
PlayerTextDrawColor(playerid, Textdraw0[playerid], 0);
PlayerTextDrawUseBox(playerid, Textdraw0[playerid], true);
PlayerTextDrawBoxColor(playerid, Textdraw0[playerid], 102);
PlayerTextDrawSetShadow(playerid, Textdraw0[playerid], 0);
PlayerTextDrawSetOutline(playerid, Textdraw0[playerid], 0);
PlayerTextDrawFont(playerid, Textdraw0[playerid], 0);
PlayerTextDrawSetSelectable(playerid,Textdraw0[playerid], 1);
PlayerTextDrawShow(playerid, Textdraw0[playerid]);
and
Код:
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
if(playertextid == Textdraw0[playerid])
{
SendClientMessage(playerid, 0xFFFFFFAA, "You clicked on a textdraw.");
CancelSelectTextDraw(playerid);
}
return 1;
}
Please help me
Re: TextDrawClickable doesn't work.. -
mafiatoss - 17.11.2012
Up Please
Re: TextDrawClickable doesn't work.. -
Vince - 17.11.2012
Clickable area is defined by TextDrawTextSize. You have set the height to 0, so no clickable area. Secondly, you forgot TextDrawSetSelectable.
Re: TextDrawClickable doesn't work.. -
mafiatoss - 17.11.2012
I don't have forgot the callback selectable : PlayerTextDrawSetSelectable(playerid,Textdraw0[playerid], 1);
I have try to size the height to 10 and it's doesn't work :/
Re: TextDrawClickable doesn't work.. -
mafiatoss - 18.11.2012
Up
Fixed !