[DUV] Ler linhas
#5

Ah,mas enfim,tente isto:

pawn Код:
if(strcmp(cmdtext, "/lerdadosveiculos", true) == 0)
{
    new
        File:zFile = fopen("Veiculos.txt", io_read);
    static
        sLine[150],
        zString[1024],
        zCountVirgulas;

    while(fread(zFile,sLine))
    {
        for(new i; sLine[i]; i++)
        {
            if(sLine[i] == ',')
            {
                zCountVirgulas++;
                if(zCountVirgulas == 5)
                {
                    sLine[i] = '\n';       
                    zCountVirgulas = 0;                
                }
            }
        }
        strins(zString,sLine,strlen(zString),sizeof sLine);
    }
    printf(" O Arquivo tem %d de linhas",zCountVirgulas);
    return true;
}
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_MSGBOX, "-", zString, "Ok", "Fechar");
Reply


Messages In This Thread
[DUV] Ler linhas - by bugvip - 04.01.2011, 17:57
Re: [DUV] Ler linhas - by bugvip - 04.01.2011, 19:33
Respuesta: [DUV] Ler linhas - by ipsBruno - 04.01.2011, 19:38
Re: Respuesta: [DUV] Ler linhas - by bugvip - 04.01.2011, 19:42
Respuesta: [DUV] Ler linhas - by ipsBruno - 04.01.2011, 19:45
Re: [DUV] Ler linhas - by bugvip - 04.01.2011, 19:47
Respuesta: [DUV] Ler linhas - by ipsBruno - 04.01.2011, 19:48
Respuesta: [DUV] Ler linhas - by ipsBruno - 04.01.2011, 19:53
Re: [DUV] Ler linhas - by bugvip - 04.01.2011, 20:24
Re: [DUV] Ler linhas - by bugvip - 05.01.2011, 16:21

Forum Jump:


Users browsing this thread: 1 Guest(s)