22.05.2017, 20:08
Код:
stock fcreate(filename[]) { if(fexist(filename)) return false; new File:file = fopen(filename, io_write); return fclose(file); }
Код:
stock SaveActors() { new string[512], File: file; if(!fexist("ActorStudio.ini")) fcreate("ActorStudio.ini"); if(fexist("ActorStudio.ini")) { file = fopen("ActorStudio.ini", io_write); for(new a; a < MAX_ACTORS; a++) { format(string, sizeof(string), "%d|%.02f|%.02f|%.02f|%.02f|%d|%s|%.02f|%s|%d|%d|%d|%d|%d|%.02f\r\n", AI[a][aModel], AI[a][aX], AI[a][aY], AI[a][aZ], AI[a][aR], AI[a][aVW], AI[a][aAnimLib], AI[a][aAnimDelta], AI[a][aAnimName], AI[a][aAnimLoop], AI[a][aAnimLockX], AI[a][aAnimLockY], AI[a][aAnimFreeze], AI[a][aAnimTime], AI[a][aDynamicAreaRadius]); fwrite(file, string); } } return fclose(file); }
Код:
fwrite(file, string); fwrite(file, "\r\n"); fclose(file);
Код:
fwrite(file, str); fwrite(file, "\r\n"); fclose(file);
Код:
Server_Save() { new File:file = fopen("server.ini", io_write), str[128]; format(str, sizeof(str), "TaxMoney = %d\n", g_TaxVault); return (fwrite(file, str), fclose(file)); }
Код:
Server_Load() { new File:file = fopen("server.ini", io_read); if (file) { g_TaxVault = file_parse_int(file, "TaxMoney"); fclose(file); } return 1; }