Portal SAMP
[Ajuda] TextDraw - Versão de Impressão

+- Portal SAMP (https://portalsamp.com)
+-- Fórum: SA-MP (https://portalsamp.com/forumdisplay.php?fid=5)
+--- Fórum: Área de suporte (https://portalsamp.com/forumdisplay.php?fid=6)
+--- Tópico: [Ajuda] TextDraw (/showthread.php?tid=1818)



TextDraw - geek - 06/11/2021

Estou tentado fazer meu sistema de registro por textdraw , na parte das selecionaveis , quando eu clico não acontece nada 

(obs: está para retornar a mensagem ao player apenas para teste) .

na função PlayerTextDrawSetSelectable , já tentei true e o valor de 1

Código:
public OnPlayerConnect(playerid)
{

    TDEditor_PTD[playerid][0] = CreatePlayerTextDraw(playerid, 34.069152, 252.583267, "REGISTRAR-ME");
    PlayerTextDrawLetterSize(playerid, TDEditor_PTD[playerid][0], 0.400000, 1.600000);
    PlayerTextDrawAlignment(playerid, TDEditor_PTD[playerid][0], 1);
    PlayerTextDrawColor(playerid, TDEditor_PTD[playerid][0], -1061109505);
    PlayerTextDrawSetShadow(playerid, TDEditor_PTD[playerid][0], 1);
    PlayerTextDrawBackgroundColor(playerid, TDEditor_PTD[playerid][0], 255);
    PlayerTextDrawFont(playerid, TDEditor_PTD[playerid][0], 2);
    PlayerTextDrawSetProportional(playerid, TDEditor_PTD[playerid][0], 1);
    PlayerTextDrawSetSelectable(playerid, TDEditor_PTD[playerid][0], 1);

    TDEditor_PTD[playerid][1] = CreatePlayerTextDraw(playerid, 30.095062, 284.299987, "REGRAS_GERAIS");
    PlayerTextDrawLetterSize(playerid, TDEditor_PTD[playerid][1], 0.400000, 1.600000);
    PlayerTextDrawAlignment(playerid, TDEditor_PTD[playerid][1], 1);
    PlayerTextDrawColor(playerid, TDEditor_PTD[playerid][1], -1061109505);
    PlayerTextDrawSetShadow(playerid, TDEditor_PTD[playerid][1], 1);
    PlayerTextDrawBackgroundColor(playerid, TDEditor_PTD[playerid][1], 255);
    PlayerTextDrawFont(playerid, TDEditor_PTD[playerid][1], 2);
    PlayerTextDrawSetProportional(playerid, TDEditor_PTD[playerid][1], 1);
    PlayerTextDrawSetSelectable(playerid, TDEditor_PTD[playerid][1], 1);

    TDEditor_PTD[playerid][2] = CreatePlayerTextDraw(playerid, 50.441467, 316.650146, "CREDITOS");
    PlayerTextDrawLetterSize(playerid, TDEditor_PTD[playerid][2], 0.400000, 1.600000);
    PlayerTextDrawAlignment(playerid, TDEditor_PTD[playerid][2], 1);
    PlayerTextDrawColor(playerid, TDEditor_PTD[playerid][2], -1061109505);
    PlayerTextDrawSetShadow(playerid, TDEditor_PTD[playerid][2], 1);
    PlayerTextDrawBackgroundColor(playerid, TDEditor_PTD[playerid][2], 255);
    PlayerTextDrawFont(playerid, TDEditor_PTD[playerid][2], 2);
    PlayerTextDrawSetProportional(playerid, TDEditor_PTD[playerid][2], 1);
    PlayerTextDrawSetSelectable(playerid, TDEditor_PTD[playerid][2], 1);

    TDEditor_PTD[playerid][3] = CreatePlayerTextDraw(playerid, 71.950798, 348.566772, "SAIR");
    PlayerTextDrawLetterSize(playerid, TDEditor_PTD[playerid][3], 0.400000, 1.600000);
    PlayerTextDrawAlignment(playerid, TDEditor_PTD[playerid][3], 1);
    PlayerTextDrawColor(playerid, TDEditor_PTD[playerid][3], -1061109505);
    PlayerTextDrawSetShadow(playerid, TDEditor_PTD[playerid][3], 1);
    PlayerTextDrawBackgroundColor(playerid, TDEditor_PTD[playerid][3], 255);
    PlayerTextDrawFont(playerid, TDEditor_PTD[playerid][3], 2);
    PlayerTextDrawSetProportional(playerid, TDEditor_PTD[playerid][3], 1);
    PlayerTextDrawSetSelectable(playerid, TDEditor_PTD[playerid][3], 1);
    return 1;
}

Código:
stock MostrarLogin(playerid)
{
    PlayerTextDrawShow(playerid, TDEditor_PTD[playerid][0]);
    PlayerTextDrawShow(playerid, TDEditor_PTD[playerid][1]);
    PlayerTextDrawShow(playerid, TDEditor_PTD[playerid][2]);
    PlayerTextDrawShow(playerid, TDEditor_PTD[playerid][3]);
    return 1;
}

public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
    if (playertextid == TDEditor_PTD[playerid][0])
    {
         SendClientMessage(playerid, 0xFFFFFFAA, "You clicked on a textdraw.");
         CancelSelectTextDraw(playerid);
         return 1;
    }
    if (playertextid == TDEditor_PTD[playerid][1])
    {
         SendClientMessage(playerid, 0xFFFFFFAA, "You clicked on a textdraw.");
         CancelSelectTextDraw(playerid);
         return 1;
    }
    if (playertextid == TDEditor_PTD[playerid][2])
    {
         SendClientMessage(playerid, 0xFFFFFFAA, "You clicked on a textdraw.");
         CancelSelectTextDraw(playerid);
         return 1;
    }
    if (playertextid == TDEditor_PTD[playerid][3])
    {
         SendClientMessage(playerid, 0xFFFFFFAA, "You clicked on a textdraw.");
         CancelSelectTextDraw(playerid);
         return 1;
    }
    return 0;
}



RE: TextDraw - EXPEDITO_011 - 06/11/2021

(06/11/2021 23:04)geek Escreveu: Estou tentado fazer meu sistema de registro por textdraw , na parte das selecionaveis , quando eu clico não acontece nada 

(obs: está para retornar a mensagem ao player apenas para teste) .

na função PlayerTextDrawSetSelectable , já tentei true e o valor de 1

Código:
public OnPlayerConnect(playerid)
{

    TDEditor_PTD[playerid][0] = CreatePlayerTextDraw(playerid, 34.069152, 252.583267, "REGISTRAR-ME");
    PlayerTextDrawLetterSize(playerid, TDEditor_PTD[playerid][0], 0.400000, 1.600000);
    PlayerTextDrawAlignment(playerid, TDEditor_PTD[playerid][0], 1);
    PlayerTextDrawColor(playerid, TDEditor_PTD[playerid][0], -1061109505);
    PlayerTextDrawSetShadow(playerid, TDEditor_PTD[playerid][0], 1);
    PlayerTextDrawBackgroundColor(playerid, TDEditor_PTD[playerid][0], 255);
    PlayerTextDrawFont(playerid, TDEditor_PTD[playerid][0], 2);
    PlayerTextDrawSetProportional(playerid, TDEditor_PTD[playerid][0], 1);
    PlayerTextDrawSetSelectable(playerid, TDEditor_PTD[playerid][0], 1);

    TDEditor_PTD[playerid][1] = CreatePlayerTextDraw(playerid, 30.095062, 284.299987, "REGRAS_GERAIS");
    PlayerTextDrawLetterSize(playerid, TDEditor_PTD[playerid][1], 0.400000, 1.600000);
    PlayerTextDrawAlignment(playerid, TDEditor_PTD[playerid][1], 1);
    PlayerTextDrawColor(playerid, TDEditor_PTD[playerid][1], -1061109505);
    PlayerTextDrawSetShadow(playerid, TDEditor_PTD[playerid][1], 1);
    PlayerTextDrawBackgroundColor(playerid, TDEditor_PTD[playerid][1], 255);
    PlayerTextDrawFont(playerid, TDEditor_PTD[playerid][1], 2);
    PlayerTextDrawSetProportional(playerid, TDEditor_PTD[playerid][1], 1);
    PlayerTextDrawSetSelectable(playerid, TDEditor_PTD[playerid][1], 1);

    TDEditor_PTD[playerid][2] = CreatePlayerTextDraw(playerid, 50.441467, 316.650146, "CREDITOS");
    PlayerTextDrawLetterSize(playerid, TDEditor_PTD[playerid][2], 0.400000, 1.600000);
    PlayerTextDrawAlignment(playerid, TDEditor_PTD[playerid][2], 1);
    PlayerTextDrawColor(playerid, TDEditor_PTD[playerid][2], -1061109505);
    PlayerTextDrawSetShadow(playerid, TDEditor_PTD[playerid][2], 1);
    PlayerTextDrawBackgroundColor(playerid, TDEditor_PTD[playerid][2], 255);
    PlayerTextDrawFont(playerid, TDEditor_PTD[playerid][2], 2);
    PlayerTextDrawSetProportional(playerid, TDEditor_PTD[playerid][2], 1);
    PlayerTextDrawSetSelectable(playerid, TDEditor_PTD[playerid][2], 1);

    TDEditor_PTD[playerid][3] = CreatePlayerTextDraw(playerid, 71.950798, 348.566772, "SAIR");
    PlayerTextDrawLetterSize(playerid, TDEditor_PTD[playerid][3], 0.400000, 1.600000);
    PlayerTextDrawAlignment(playerid, TDEditor_PTD[playerid][3], 1);
    PlayerTextDrawColor(playerid, TDEditor_PTD[playerid][3], -1061109505);
    PlayerTextDrawSetShadow(playerid, TDEditor_PTD[playerid][3], 1);
    PlayerTextDrawBackgroundColor(playerid, TDEditor_PTD[playerid][3], 255);
    PlayerTextDrawFont(playerid, TDEditor_PTD[playerid][3], 2);
    PlayerTextDrawSetProportional(playerid, TDEditor_PTD[playerid][3], 1);
    PlayerTextDrawSetSelectable(playerid, TDEditor_PTD[playerid][3], 1);
    return 1;
}

Código:
stock MostrarLogin(playerid)
{
    PlayerTextDrawShow(playerid, TDEditor_PTD[playerid][0]);
    PlayerTextDrawShow(playerid, TDEditor_PTD[playerid][1]);
    PlayerTextDrawShow(playerid, TDEditor_PTD[playerid][2]);
    PlayerTextDrawShow(playerid, TDEditor_PTD[playerid][3]);
    return 1;
}

public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
    if (playertextid == TDEditor_PTD[playerid][0])
    {
         SendClientMessage(playerid, 0xFFFFFFAA, "You clicked on a textdraw.");
         CancelSelectTextDraw(playerid);
         return 1;
    }
    if (playertextid == TDEditor_PTD[playerid][1])
    {
         SendClientMessage(playerid, 0xFFFFFFAA, "You clicked on a textdraw.");
         CancelSelectTextDraw(playerid);
         return 1;
    }
    if (playertextid == TDEditor_PTD[playerid][2])
    {
         SendClientMessage(playerid, 0xFFFFFFAA, "You clicked on a textdraw.");
         CancelSelectTextDraw(playerid);
         return 1;
    }
    if (playertextid == TDEditor_PTD[playerid][3])
    {
         SendClientMessage(playerid, 0xFFFFFFAA, "You clicked on a textdraw.");
         CancelSelectTextDraw(playerid);
         return 1;
    }
    return 0;
}


https://sampwiki.blast.hk/wiki/OnPlayerClickPlayerTextDraw


RE: TextDraw - geek - 06/11/2021

está da mesma forma


RE: TextDraw - MarcosBrazz - 07/11/2021

Você está colocando SelectTextDraw ao mostrar as textdraws?


RE: TextDraw - xbruno1000x - 07/11/2021

Código:
stock MostrarLogin(playerid)
{
    PlayerTextDrawShow(playerid, TDEditor_PTD[playerid][0]);
    PlayerTextDrawShow(playerid, TDEditor_PTD[playerid][1]);
    PlayerTextDrawShow(playerid, TDEditor_PTD[playerid][2]);
    PlayerTextDrawShow(playerid, TDEditor_PTD[playerid][3]);
    SelectTextDraw(playerid, 0x00FF00FF); // Highlight green when hovering over
    return 1;


Tente assim


RE: TextDraw - geek - 08/11/2021

(07/11/2021 12:07)xbruno1000x Escreveu:
Código:
stock MostrarLogin(playerid)
{
    PlayerTextDrawShow(playerid, TDEditor_PTD[playerid][0]);
    PlayerTextDrawShow(playerid, TDEditor_PTD[playerid][1]);
    PlayerTextDrawShow(playerid, TDEditor_PTD[playerid][2]);
    PlayerTextDrawShow(playerid, TDEditor_PTD[playerid][3]);
    SelectTextDraw(playerid, 0x00FF00FF); // Highlight green when hovering over
    return 1;


Tente assim
Deu certo obg a todos