[AJUDA] Nгo Escreve no .Txt
#1

Alguem ajuda !
se o file nao existir ele cria, mas nao escreve nada lб dentro.




Код:
no inicio #define FILE_NAME "log/gravardata.txt"





public gravardata(playerid)
{



new File:gstats;
new string[256];
new pname[24];
new str[256];
new ccurdate = getdate();




    
 gstats=fopen(FILE_NAME, io_append);
 GetPlayerName(playerid, pname, 24); 
 format(str, 30, "%s %d \n\r",pname,ccurdate); 
 if(!gstats) { fcreate(FILE_NAME); }

  while(fread(gstats, string))
  {
   if(strcmp(string, pname, false, strlen(pname))==0)
   {
     fdeleteline(FILE_NAME, string); 
     fwrite(gstats, str);
     
   }
   else if(strcmp(string, pname, false, strlen(pname))!=0) {
    fwrite(gstats, str);

  }
 }
 fclose(gstats);


return 1;
}
Obrigado
Reply


Messages In This Thread
[AJUDA] Nгo Escreve no .Txt - by telmo_ferreira - 14.11.2011, 14:36
Re: [AJUDA] Nгo Escreve no .Txt - by Lуs - 14.11.2011, 15:43
Re: [AJUDA] Nгo Escreve no .Txt - by telmo_ferreira - 14.11.2011, 16:02
Re: [AJUDA] Nгo Escreve no .Txt - by telmo_ferreira - 14.11.2011, 21:21
Re: [AJUDA] Nгo Escreve no .Txt - by rjjj - 14.11.2011, 21:50
Re: [AJUDA] Nгo Escreve no .Txt - by telmo_ferreira - 15.11.2011, 13:54
Re: [AJUDA] Nгo Escreve no .Txt - by telmo_ferreira - 16.11.2011, 19:35

Forum Jump:


Users browsing this thread: 2 Guest(s)