16.11.2011, 22:37
This commands are working on windows loaded pc, but doesn't on linux . It gives crash. anyone knows How to fix?
Code:
#define FILE_NAME "log/gravardata.txt" public actualizardata(playerid) { if(PlayerInfo[playerid][pPhousekey] == 255) { return 1; } if(PlayerInfo[playerid][pPhousekey] <11 ) { return 1; } new chave; new str[128]; new File:gstats; new day,month,year; getdate(day,month,year); chave = PlayerInfo[playerid][pPhousekey]; format(str, sizeof(str), "Casa Nє%d",chave); fdeleteline(FILE_NAME,str); new sstr[128]; format(sstr, sizeof(sstr), "Casa Nє%d Data: %d.%d.%d \r<br>\n",chave,day,month,year); gstats=fopen(FILE_NAME, io_append); fwrite(gstats, sstr); fclose(gstats); return 1; } stock fdeleteline(filename[], removed[]) { new string[64], str[32], File:handle, File:ftmp; handle = fopen(filename,io_read); format(str,sizeof(str),"%s.part",filename); ftmp = fopen(str,io_write); while(fread(handle,string)) if(strfind(string,removed) == -1) fwrite(ftmp,string); fclose(handle); fclose(ftmp); handle = fopen(filename,io_write); ftmp = fopen(str,io_read); while(fread(ftmp,string)) fwrite(handle,string); fclose(handle); fclose(ftmp); return fremove(str); }