SA-MP Forums Archive
[Ajuda] Registro TextDraw - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Registro TextDraw (/showthread.php?tid=658878)



Registro TextDraw - Ryuzaki07 - 15.09.2018

Boa noite, estou estudando TextDraw e para isso comecei fazer um registro sу q estou com um problema, quando estou no ITD ta tudo perfeitinho, sу q ao passar pro meu GM da erro, exemplo:

Aqui й no ITD: https://imgur.com/a/KQSMOuH

e aqui й como fica no GM: https://imgur.com/a/E72HoTq

As ''frases'' onde й para o player clicar e interagir some.

aqui esta o cуdigo: https://pastebin.com/hW70h6rL

Obs: Fiz isso ao observar um tutorial no ******* de um gringo, pois nгo achei aqui no fуrum, se tiver algum aqui no fуrum por favor me passem tambйm.


Re: Registro TextDraw - ChapN - 15.09.2018

Arrumei o cуdigo, estava cheio de avisos, assim que aparecer avisos na copilaзгo, й sempre bom procurar saber o que й.

Vocк estava usando new PlayerText e nos clicбveis estava usando TextDrawShowForPlayer, mas o correto й usar PlayerTextDrawShow.

https://pastebin.com/eWLckLgV


Re: Registro TextDraw - Ryuzaki07 - 15.09.2018

Quote:
Originally Posted by ChapN
Посмотреть сообщение
Arrumei o cуdigo, estava cheio de avisos, assim que aparecer avisos na copilaзгo, й sempre bom procurar saber o que й.

Vocк estava usando new PlayerText e nos clicбveis estava usando TextDrawShowForPlayer, mas o correto й usar PlayerTextDrawShow.

https://pastebin.com/eWLckLgV
Opa muito obrigado, resolveu, mas tem um outro problema, Sabe por que nгo esta abrindo a dialog?

PHP код:
public OnPlayerClickPlayerTextDraw(playeridPlayerText:playertextid)
 {
  if(
playertextid == CrieUmaSenha[playerid])
 {
  
ShowPlayerDialog(playeriddialog_registroDIALOG_STYLE_PASSWORD"Insira uma senha""por favor crie uma senha""Registrar","Cancel");
  }
  return 
1;
  } 



Re: Registro TextDraw - ChapN - 15.09.2018

Faz assim:

Adicione isso no final do CrieUmaSenha[playerid].


PHP код:
PlayerTextDrawSetSelectable(playeridCrieUmaSenha[playerid], 1); 
Vai ficar assim;
PHP код:
CrieUmaSenha[playerid] = CreatePlayerTextDraw(playerid452.235290168.583328"CRIE UMA SENHA");
PlayerTextDrawLetterSize(playeridCrieUmaSenha[playerid], 0.4259981.448333);
PlayerTextDrawAlignment(playeridCrieUmaSenha[playerid], 1);
PlayerTextDrawColor(playeridCrieUmaSenha[playerid], -2139062017);
PlayerTextDrawSetShadow(playeridCrieUmaSenha[playerid], 0);
PlayerTextDrawSetOutline(playeridCrieUmaSenha[playerid], 1);
PlayerTextDrawBackgroundColor(playeridCrieUmaSenha[playerid], 51);
PlayerTextDrawFont(playeridCrieUmaSenha[playerid], 2);
PlayerTextDrawSetProportional(playeridCrieUmaSenha[playerid], 1);
PlayerTextDrawSetSelectable(playeridCrieUmaSenha[playerid], 1); // Adicionado no final 
Agora no OnPlayerClickPlayerTextDraw faz desse jeito;
PHP код:
public OnPlayerClickPlayerTextDraw(playeridPlayerText:playertextid)
{
    if(
playertextid == CrieUmaSenha[playerid])
    {
    
ShowPlayerDialog(playeriddialog_registroDIALOG_STYLE_PASSWORD"Insira uma senha""por favor crie uma senha""Registrar","Cancel");
    return 
1;
    }
    return 
0;




Re: Registro TextDraw - Jonorusc - 15.09.2018

Este erro й no textsize

//PlayerTextDrawTextSize(playerid, TextDraw[playerid], x, y);
//TextDrawTextSize(TextDraw, x, y);

se nгo sabes colocar o size use null

ipleomax?

Podes usar Player ou Normal TexDraw

PHP код:
new text:click; or new text:click[MAX_PLAYERS]
 
click TextDrawCreate(xy"Click");
 
click[playerid] = TextDrawCreate(xy"Click");
public 
OnPlayerClickTextDraw(playeridText:clickedid)
{
//if or switch
if(clickedid == click//or if(clickedid == clik[playerid])
{
  Function;
  
//podes retornar algo
}
return 
1;

PHP код:
new PlayerText:click[MAX_PLAYERS];
click[playerid] = CreatePlayerTextDraw(playeridxy"Click");
public 
OnPlayerClickPlayerTextDraw(playeridPlayerText:playertextid)
{
if(
playertextid == click[playerid])
{
  Function;
  
//podes retornar algo
}
return 
1;




Re: Registro TextDraw - Ryuzaki07 - 15.09.2018

Opa muito obrigado deu certinho, agora sу estou com mais uma duvida q to me matando pra resolver ... Olha quando passa mouse em cima da TextDraw ela muda a cor pois foi selecionada, ok!

print : https://imgur.com/a/rLjhfXA

sу q mesmo eu n estando mais com o mouse em cima da text ainda fica selecionada.

print : https://imgur.com/a/D1bdQim

No caso dessa ultima print meu mouse estava ali onde esta o circulo vermelho.

pra arrumar isso eu teria q alterar y e x aqui na
Quote:

TextDrawTextSize(Textdraw7, 300, 20);

Correto?