25.01.2015, 12:29
Hey guys, so I just want to save and load a few variables, I tought the best way to do this would be with a .txt or a .ini file. So after searching for more information on both sides I ended up with an unfinished code, stuck without a clue. I barely had an idea of what I was doing but this is what I got
pawn Код:
//saving
fremove("headquarters.txt");
new File:file = fopen("headquarters.txt", io_append),logs[178];
for(new i = 0; i < 5; i++)
{
format(logs,sizeof(logs),"hq%d = %d\r\n",i,hq[i]);
fwrite(file,logs);
}
fclose(file);
//loading, what I want here is that it stores the numbers back into the variables
new File:file = fopen("headquarters.txt", io_read);
while(fread(file,string))
{
}