14.11.2011, 14:36
Alguem ajuda !
se o file nao existir ele cria, mas nao escreve nada lб dentro.
Obrigado
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; }