Textdraw not clickable - but it's set. -
Zeppo - 28.03.2014
I was making a login screen with iPLEOMAX's Textdraw editor and when I make the "Login" and "Register" textdraws clickable, they don't seem to work(I had a problem with them so I put them in a command /show, but loaded them when the player connects)
pawn Код:
CMD:show(playerid, params[])
{
TextDrawShowForPlayer(playerid, Text:Textdraw0);
TextDrawShowForPlayer(playerid, Text:Textdraw1);
TextDrawShowForPlayer(playerid, Text:Textdraw2);
TextDrawShowForPlayer(playerid, Text:Textdraw3);
PlayerTextDrawShow(playerid, Login[playerid]);
PlayerTextDrawShow(playerid, Register[playerid]);
SelectTextDraw(playerid, 0xFF000088);
return 1;
}
pawn Код:
Login[playerid] = CreatePlayerTextDraw(playerid, 216.000030, 176.296310, "Login");
PlayerTextDrawLetterSize(playerid, Login[playerid], 0.449999, 1.600000);
PlayerTextDrawAlignment(playerid, Login[playerid], 1);
PlayerTextDrawColor(playerid, Login[playerid], -1);
PlayerTextDrawSetShadow(playerid, Login[playerid], 0);
PlayerTextDrawSetOutline(playerid, Login[playerid], 1);
PlayerTextDrawBackgroundColor(playerid, Login[playerid], 51);
PlayerTextDrawFont(playerid, Login[playerid], 2);
PlayerTextDrawSetProportional(playerid, Login[playerid], 1);
PlayerTextDrawTextSize(playerid, PlayerText:Login[playerid], 100, 10);
Register[playerid] = CreatePlayerTextDraw(playerid, 359.666625, 175.881439, "Register");
PlayerTextDrawLetterSize(playerid, Register[playerid], 0.449999, 1.600000);
PlayerTextDrawAlignment(playerid, Register[playerid], 1);
PlayerTextDrawColor(playerid, Register[playerid], -1);
PlayerTextDrawSetShadow(playerid, Register[playerid], 0);
PlayerTextDrawSetOutline(playerid, Register[playerid], 1);
PlayerTextDrawBackgroundColor(playerid, Register[playerid], 51);
PlayerTextDrawFont(playerid, Register[playerid], 2);
PlayerTextDrawSetProportional(playerid, Register[playerid], 1);
PlayerTextDrawTextSize(playerid, PlayerText:Register[playerid], 100, 10);
Re: Textdraw not clickable - but it's set. -
Pillhead2007 - 29.03.2014
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(clickedid == Login[playerid]
{
///your commands
}
return 1;
}
or use this tutorial
https://sampforum.blast.hk/showthread.php?tid=328267
Re: Textdraw not clickable - but it's set. -
Zeppo - 29.03.2014
I have that..
Re: Textdraw not clickable - but it's set. -
Pottus - 29.03.2014
https://sampwiki.blast.hk/wiki/PlayerTextDrawSetSelectable
Going to recommend that you round out your creation values to the nearest pixel (216.000030, 176.296310) this will ensure that your TD's look good on all resolutions.
Re: Textdraw not clickable - but it's set. -
Zeppo - 29.03.2014
pawn Код:
Login[playerid] = CreatePlayerTextDraw(playerid, 216.000030, 176.296310, "Login");
PlayerTextDrawLetterSize(playerid, Login[playerid], 0.449999, 1.600000);
PlayerTextDrawAlignment(playerid, Login[playerid], 1);
PlayerTextDrawColor(playerid, Login[playerid], -1);
PlayerTextDrawSetShadow(playerid, Login[playerid], 0);
PlayerTextDrawSetOutline(playerid, Login[playerid], 1);
PlayerTextDrawBackgroundColor(playerid, Login[playerid], 51);
PlayerTextDrawFont(playerid, Login[playerid], 2);
PlayerTextDrawSetProportional(playerid, Login[playerid], 1);
PlayerTextDrawTextSize(playerid, PlayerText:Login[playerid], 100, 10);
TextDrawSetSelectable(playerid, Login[playerid], 1);
Register[playerid] = CreatePlayerTextDraw(playerid, 359.666625, 175.881439, "Register");
PlayerTextDrawLetterSize(playerid, Register[playerid], 0.449999, 1.600000);
PlayerTextDrawAlignment(playerid, Register[playerid], 1);
PlayerTextDrawColor(playerid, Register[playerid], -1);
PlayerTextDrawSetShadow(playerid, Register[playerid], 0);
PlayerTextDrawSetOutline(playerid, Register[playerid], 1);
PlayerTextDrawBackgroundColor(playerid, Register[playerid], 51);
PlayerTextDrawFont(playerid, Register[playerid], 2);
PlayerTextDrawSetProportional(playerid, Register[playerid], 1);
PlayerTextDrawTextSize(playerid, PlayerText:Register[playerid], 100, 10);
TextDrawSetSelectable(playerid, Register[playerid], 1);
I already have TextDrawSetSelectable but it still don't work.
These are the errors:
pawn Код:
C:\Users\Jamie\Desktop\SAMP\gamemodes\JRP.pwn(1141) : warning 213: tag mismatch
C:\Users\Jamie\Desktop\SAMP\gamemodes\JRP.pwn(1141) : warning 213: tag mismatch
C:\Users\Jamie\Desktop\SAMP\gamemodes\JRP.pwn(1141) : warning 202: number of arguments does not match definition
C:\Users\Jamie\Desktop\SAMP\gamemodes\JRP.pwn(1153) : warning 213: tag mismatch
C:\Users\Jamie\Desktop\SAMP\gamemodes\JRP.pwn(1153) : warning 213: tag mismatch
C:\Users\Jamie\Desktop\SAMP\gamemodes\JRP.pwn(1153) : warning 202: number of arguments does not match definition
Error lines are:
pawn Код:
TextDrawSetSelectable(playerid, Login[playerid], 1);
and
TextDrawSetSelectable(playerid, Register[playerid], 1);
Re: Textdraw not clickable - but it's set. -
Matess - 29.03.2014
PlayerTextDrawSetSelectable
pawn Код:
PlayerTextDrawSetSelectable(playerid, Login[playerid], 1);
PlayerTextDrawSetSelectable(playerid, Register[playerid], 1);
Re: Textdraw not clickable - but it's set. -
Zeppo - 29.03.2014
ffs I'm so stupid. Thanks!