Server crashing
#5

Код:
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;
}
Reply


Messages In This Thread
Server crashing - by Xleone - 21.05.2017, 19:47
Re: Server crashing - by Vince - 21.05.2017, 20:27
Re: Server crashing - by Xleone - 22.05.2017, 19:50
Re: Server crashing - by YouHack - 22.05.2017, 19:58
Re: Server crashing - by Xleone - 22.05.2017, 20:08
Re: Server crashing - by YouHack - 22.05.2017, 20:49

Forum Jump:


Users browsing this thread: 1 Guest(s)