27.06.2009, 08:10
Quote:
format(var, 128, "Passwort=%s\n",Stat[playerid][password]);fwrite(hFile, var); format(var, 128, "Level=%d\n",Stat[playerid][level]);fwrite(hFile, var); |
Now I want to read all this stuff from this file..
Quote:
new File: UserFile = fopen(string, io_read); if ( UserFile ) { new keytmp[256], valtmp[2][256]; while(fread( UserFile , keytmp , sizeof( keytmp ))) { split(keytmp, valtmp, '='); if(strcmp(valtmp[0], "Passwort", true) == 0) { strmid(Stat[playerid][password], valtmp[1], 0, strlen(valtmp[1]), 255); } } if(!(strcmp(Stat[playerid][password], tmppass, true) == 0)) { SendUserMessage(playerid, COLOR_GREY, "Wrong password !", "Falsches Passwort!"); Kick(playerid); return 1; } |
What did I do wrong? (I typed in the correct password :d )