PlayerTextDrawSetString don't work.
#1

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);
Reply
#2

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

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 ()?
Reply
#4

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

How do I run strval?
Reply
#5

Upppp
Reply
#6

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

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); 
Reply
#8

Thanks man <3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)