Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- forward LoadSef();
- public LoadSef()
- {
- new arrCoords[2][64];
- new strFromFile2[256];
- new File: file = fopen("cfg/sefovi.cfg", io_read);
- if (file)
- {
- new idx;
- while (idx < sizeof(SefInfo))
- {
- fread(file, strFromFile2);
- split(strFromFile2, arrCoords, '|');
- SefInfo[idx][sDroga] = strval(arrCoords[0]);
- SefInfo[idx][sMoney] = strval(arrCoords[1]);
- printf("SefInfo:%d Droga:%d Money:%d.\n",
- idx,
- SefInfo[idx][sDroga],
- SefInfo[idx][sMoney]);
- idx++;
- }
- fclose(file);
- }
- return 1;
- }
- ////////////////////////////////////////////////////////
- forward SaveSef();
- public SaveSef()
- {
- new idx;
- while (idx < sizeof(SefInfo))
- {
- new coordsstring[256];
- format(coordsstring, sizeof(coordsstring), "%d %d", SefInfo[idx][sDroga], SefInfo[idx][sMoney] );
- new File: file2 = fopen("cfg/sefovi.cfg", io_write);
- fwrite(file2, coordsstring);
- fclose(file2);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment