Textdraw - 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 (
/showthread.php?tid=603376)
Textdraw -
K0P - 22.03.2016
The problem is that the textdraws dont get selected
Код:
Textdraw6 = TextDrawCreate(303.555511, 153.813339, "LOGIN");
TextDrawLetterSize(Textdraw6, 0.449999, 1.600000);
TextDrawAlignment(Textdraw6, 1);
TextDrawColor(Textdraw6, -1);
TextDrawSetShadow(Textdraw6, 0);
TextDrawSetOutline(Textdraw6, 1);
TextDrawBackgroundColor(Textdraw6, 51);
TextDrawFont(Textdraw6, 3);
TextDrawSetProportional(Textdraw6, 1);
TextDrawTextSize(Textdraw6, 10.0,10.0);
TextDrawSetSelectable(Textdraw6, true);
Textdraw4 = TextDrawCreate(288.888916, 120.960006, "REGISTER");
TextDrawLetterSize(Textdraw4, 0.449999, 1.600000);
TextDrawAlignment(Textdraw4, 1);
TextDrawColor(Textdraw4, -1);
TextDrawSetShadow(Textdraw4, 0);
TextDrawSetOutline(Textdraw4, 1);
TextDrawBackgroundColor(Textdraw4, 51);
TextDrawFont(Textdraw4, 3);
TextDrawSetProportional(Textdraw4, 1);
TextDrawTextSize(Textdraw4, 10.0,10.0);
TextDrawSetSelectable(Textdraw4, true);
Код:
TextDrawShowForPlayer(playerid, Textdraw4);
TextDrawShowForPlayer(playerid, Textdraw6);
SelectTextDraw(playerid, COLOR_GREY);
Note: I used iTD for the textdraws
Re: Textdraw -
F1N4L - 22.03.2016
PHP код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_SUBMISSION)
{
TextDrawShowForPlayer(playerid, Textdraw4);
TextDrawShowForPlayer(playerid, Textdraw6);
SelectTextDraw(playerid, COLOR_GREY);
}
return 1;
}
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(clickedid == Textdraw4)
{
SendClientMessage(playerid, 0xFFFFFFAA, "You clicked on a Textdraw4.");
CancelSelectTextDraw(playerid);
}
else if(clickedid == Textdraw6)
{
SendClientMessage(playerid, 0xFFFFFFAA, "You clicked on a Textdraw6.");
CancelSelectTextDraw(playerid);
}
return 1;
}
Being REGISTER and LOGIN, you should use PlayerTextDraw...?
Sorry my bad english :c
Re: Textdraw -
K0P - 22.03.2016
I used the same method.
Re: Textdraw -
UltraScripter - 22.03.2016
Use OnPlayerClickTextDraw
Re: Textdraw -
UltraScripter - 22.03.2016
PHP код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(clickedid != Text:INVALID_TEXT_DRAW)
{
if(clickedid == textdraw4)
{
//login code
}
if(clickedid == textdraw6)
{
//register code
}
}
return 1;
}