Please help, Small Saving problem.
#3

ROFL, i posted the wrong script, Sorry my bad , idk why it happened any this is the right one:-


Код:
CMD:asave(playerid,params[])
{
	new ref[6],string[128];
	new code = 0;
	for(new i = 1; i <= 5;i++)
	{
	    if(stats[playerid][i][model] > 0 && stats[playerid][i][bone] > 0)
	    {
	        code++;
	        ref[i] = 1;
		}
	}
	if(!code)
	{
	    SendClientMessage(playerid,COLOR,"You don't have any attachments added ( /editor )");
	    return 1;
	}
    new name[MAX_PLAYER_NAME];
    name[playerid] = GetPlayerName(playerid, name, sizeof(name));
	format(string,sizeof(string),"%s%s.ini",SAVE_PATH,name);
	new File:oFile = fopen(string, io_write);
	if(oFile)
	{
		for(new i = 1; i <= 5; i++)
		{
		    if(stats[playerid][i][model] > 0 && stats[playerid][i][bone] > 0)
		    {
				format(string,sizeof(string),"%d,%d,%d,%.2f,%.2f,%.2f,%.1f,%.1f,%.1f,%.2f,%.2f,%.2f\n",
					(i -1),
					stats[playerid][i][model],
					stats[playerid][i][bone],
					stats[playerid][i][ox],
					stats[playerid][i][oy],
					stats[playerid][i][oz],
					stats[playerid][i][rx],
					stats[playerid][i][ry],
					stats[playerid][i][rz],
					stats[playerid][i][sx],
					stats[playerid][i][sy],
					stats[playerid][i][sz]
				);
				fwrite(oFile,string);
			}
		}
		fclose(oFile);
		format(string,sizeof(string),"%s%s.ini saved successfully",SAVE_PATH,GetPlayerName(playerid, name, sizeof(name)));
		SendClientMessage(playerid,COLOR,string);
		return 1;
	}
	SendClientMessage(playerid,COLOR,"ERROR: creating file");
	return 1;
}
Reply


Messages In This Thread
Please help, Small Saving problem. - by Swiftz - 28.04.2011, 04:34
Re: Please help, Small Saving problem. - by Anteino - 28.04.2011, 09:37
Re: Please help, Small Saving problem. - by Swiftz - 28.04.2011, 11:49
Re: Please help, Small Saving problem. - by Anteino - 28.04.2011, 12:08
Re : Please help, Small Saving problem. - by Swiftz - 28.04.2011, 12:19
Re: Please help, Small Saving problem. - by Anteino - 28.04.2011, 12:30
Re: Please help, Small Saving problem. - by MadeMan - 28.04.2011, 13:03

Forum Jump:


Users browsing this thread: 1 Guest(s)