SA-MP Forums Archive
PlayerTextDrawSetString don'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: PlayerTextDrawSetString don't work. (/showthread.php?tid=616222)



PlayerTextDrawSetString don't work. - AlexPalermitano97 - 02.09.2016

Hi guys, why when I use the function PlayerTextDrawSetString, the TD don't change a value of string?

This is a Dialog

Код HTML:
case DIALOG_NOME:
        {
            if(!response) return SCM(playerid, INFO, "* {FFFFFF}Scelta annullata");
            if(response)
            {
                new str[15];
                format(str,sizeof(str),"%s", strval(inputtext));
				PlayerTextDrawSetString(playerid, TextNomeRegistrazione[playerid], str);
				PlayerTextDrawShow(playerid, TextNomeRegistrazione[playerid]);
				PlayerInfo[playerid][pNome] = str;
				return 1;
			}
		}
This is a callback OnPlayerClickPlayerTextDraw

Код HTML:
if(playertextid == TextNomeRegistrazione[playerid])
	{
	    PlayerTextDrawHide(playerid, TextNomeRegistrazione[playerid]);
	    SPD(playerid, DIALOG_NOME, DSI, inizio" Inserisci il tuo nome", "Come ti chiami? (Digita solo il tuo nome)","Vai","Annulla");
	}
The TD is canceled while I want thar when the user click on TD name and writes his name on the dialog, the TD takes the string name that fits the dialog

This is a TD in OnPlayerConnect

Код HTML:
TextNomeRegistrazione[playerid] = CreatePlayerTextDraw(playerid, 113.850646, 133.583312, "Nome");
	PlayerTextDrawLetterSize(playerid, TextNomeRegistrazione[playerid], 0.452811, 1.600000);
	PlayerTextDrawTextSize(playerid, TextNomeRegistrazione[playerid], 218.330856, 52.499988);
	PlayerTextDrawAlignment(playerid, TextNomeRegistrazione[playerid], 1);
	PlayerTextDrawColor(playerid, TextNomeRegistrazione[playerid], -1378294017);
	PlayerTextDrawSetShadow(playerid, TextNomeRegistrazione[playerid], 0);
	PlayerTextDrawSetOutline(playerid, TextNomeRegistrazione[playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, TextNomeRegistrazione[playerid], 255);
	PlayerTextDrawFont(playerid, TextNomeRegistrazione[playerid], 2);
	PlayerTextDrawSetProportional(playerid, TextNomeRegistrazione[playerid], 1);
	PlayerTextDrawSetSelectable(playerid, TextNomeRegistrazione[playerid], true);
	PlayerTextDrawTextSize(playerid, TextNomeRegistrazione[playerid], 300,20);



Re: PlayerTextDrawSetString don't work. - Vince - 02.09.2016

Please research what strval() is actually for. It makes zero sense to use it here.


Re: PlayerTextDrawSetString don't work. - AlexPalermitano97 - 02.09.2016

What do you mean? If I am writing in the dialog Alex I should appear in Alex TD. Why does not? Is it wrong strval ()?


Re: PlayerTextDrawSetString don't work. - AlexPalermitano97 - 02.09.2016

The problem is a strval because i have changed, in the Playeratarxtdrawsetstring, str whit "Hello" and it works...

How do I run strval?


Re: PlayerTextDrawSetString don't work. - AlexPalermitano97 - 02.09.2016

Upppp


Re: PlayerTextDrawSetString don't work. - AlexPalermitano97 - 02.09.2016

Strval don't work.. What the function of string for caracter?


Re: PlayerTextDrawSetString don't work. - Shinja - 02.09.2016

Quote:
Originally Posted by Vince
Посмотреть сообщение
research what strval() is actually for
https://sampwiki.blast.hk/wiki/Strval

OT: just remove the format(str...) line and use inputtext
PHP код:
PlayerTextDrawSetString(playeridTextNomeRegistrazione[playerid], inputtext);
format(PlayerInfo[playerid][pNome], 24inputtext); 



Re: PlayerTextDrawSetString don't work. - AlexPalermitano97 - 02.09.2016

Thanks man <3