SA-MP Forums Archive
[AJUDA] Texto no Dialog - 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] Texto no Dialog (/showthread.php?tid=318582)



[AJUDA] Texto no Dialog - humildadeforever - 15.02.2012

Olб. Entгo, estou tentando fazer um sistema que salva um texto e depois um player digita o comando e vк todos textos salvos. Porйm sу aparece o primeiro, o resto nгo, jб tentei de vбrias formas, e nenhum funciona, sу aparece o primeiro :S
To usando mais ou menos assim (exemplo da WikiSamp):
pawn Код:
new string[64]; // Create the string to store the read text in
    new File:example = fopen("Startup.txt", io_read); // Open the file
    while(fread(example, string)) //reads the file line-by-line
    {
        if(strcmp(string, "Ban", true) == 0) //if any of the lines in the file say "Ban" the system will ban the player
        {
            Ban(playerid); //bans the player
        }
    }
    fclose(example);
Sу que nгo estou pondo pra banir, depois do while(fread... eu to pondo pra abrir um dialog.
pawn Код:
ShowPlayerDialog(playerid,1, DIALOG_STYLE_MSGBOX,"Texto", string,"Fechar","");
Nгo funciona...
Alguma luz ? Vlw =D



Re: [AJUDA] Texto no Dialog - Hardware - 15.02.2012

Pode usar strcat pra ir passando o texto para uma variбvel, depois de executar todo o loop, mostre o dialog com string.


Re: [AJUDA] Texto no Dialog - humildadeforever - 15.02.2012

nao entendi muito bem a parte do loop. como и para usar ele? poderia dar um exemplo por favor? obg


Re: [AJUDA] Texto no Dialog - |_MeGaTroN_| - 15.02.2012

Strcat


Re: [AJUDA] Texto no Dialog - Hardware - 15.02.2012

pawn Код:
new string[64],str[64];
    new File:example = fopen("Startup.txt", io_read);
    while(fread(example, string))
    {
        strcat(str,string);  
    }
    fclose(example);
    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Texto", str, "fechar", "");
Nгo sei se funciona, pode ser que sim.


Re: [AJUDA] Texto no Dialog - humildadeforever - 16.02.2012

Vlw! Deu certo, tinha tentado fazer assim e nгo tinha dado :S LOL, macumba. +REP pra vocк Hardware!
Aproveitando o tуpico pra nгo ter que fazer outro, me ajudem por favor a salvar as contas dos players numa pasta. Jб tentei colocar "Contas/%s.ini" Mas aн quando tб se registrando o samp-server fecha e aн o servidor cai. Jб tentei por "\Contas\%s.ini" mas dб erro e jб tentei por "Contas\%s.ini" mas ai salva o nome do player com o Contas\ antes :S
Vlww!


Re: [AJUDA] Texto no Dialog - Hardware - 16.02.2012

Use assim:

"/Contas/%s.ini"


Re: [AJUDA] Texto no Dialog - humildadeforever - 16.02.2012

Quote:
Originally Posted by Hardware
Посмотреть сообщение
Use assim:

"/Contas/%s.ini"
Jб usei tambйm, mas esqueci de falar. De qualquer forma, tentei novamente e o samp - server fecha :S


Re: [AJUDA] Texto no Dialog - |_MeGaTroN_| - 16.02.2012

Criou a pasta Contas na scriptfiles ?


Re: [AJUDA] Texto no Dialog - Hardware - 16.02.2012

Veja se criou dentro de scriptfiles e cuide com letras minъsculas e maiъsculas.