Portal SAMP
[Ajuda] Não quer setar string na 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] Não quer setar string na textdraw (/showthread.php?tid=4527)



Não quer setar string na textdraw - GreeN_ - 10/02/2024

Não esta setando a string na textdraw alguem pode me ajudar
Código:
if (dialogid == 3435) {
        if (response) {
            switch (listitem) {
                case 0 : SendClientMessage(playerid, -1, " ");
                case 1 :  {
                    new str[128];
                    for (new i = 0; i < sizeof(rgglobal); i++) TextDrawShowForPlayer(playerid, rgglobal[i]);
                    for (new i = 0; i < sizeof(rgplayer); i++) PlayerTextDrawShow(playerid, rgplayer[playerid][i]);
                    format(str, sizeof(str), "%s", pName(playerid));
                    PlayerTextDrawSetString(playerid, rgplayer[playerid][0], str);
                }
                case 2 :  {
                    for (new i = 0; i < sizeof(rgglobal); i++) TextDrawHideForPlayer(playerid, rgglobal[i]);
                    for (new i = 0; i < sizeof(rgplayer); i++) PlayerTextDrawHide(playerid, rgplayer[playerid][i]);
                }
            }
        }
        return 1;
    }



RE: Não quer setar string na textdraw - xbruno1000x - 10/02/2024

Você está exibindo as textdraws antes de setar as strings. Tem que ser feito na ordem inversa.

Código:
case 1 :  {
                    new str[128];
                    format(str, sizeof(str), "%s", pName(playerid));
                    PlayerTextDrawSetString(playerid, rgplayer[playerid][0], str);
                    for (new i = 0; i < sizeof(rgglobal); i++) TextDrawShowForPlayer(playerid, rgglobal[i]);
                    for (new i = 0; i < sizeof(rgplayer); i++) PlayerTextDrawShow(playerid, rgplayer[playerid][i]);
                }



RE: Não quer setar string na textdraw - GreeN_ - 10/02/2024

(10/02/2024 17:56)xbruno1000x Escreveu: Você está exibindo as textdraws antes de setar as strings. Tem que ser feito na ordem inversa.

Código:
                case 1 :  {
                    new str[128];
                    format(str, sizeof(str), "%s", pName(playerid));
                    PlayerTextDrawSetString(playerid, rgplayer[playerid][0], str);
                    for (new i = 0; i < sizeof(rgglobal); i++) TextDrawShowForPlayer(playerid, rgglobal[i]);
                    for (new i = 0; i < sizeof(rgplayer); i++) PlayerTextDrawShow(playerid, rgplayer[playerid][i]);
                }
obg mano