DINI Write Problem...
#1

Hey, i want to made a Job System but when i type /fertig the new Data in Folder Jobs is emtpy.
Here is my cmd:
Код:
dcmd_fertig(playerid, params[])
{
	#pragma unused params
	if(InProcess[playerid] != 6) { return SendClientMessage(playerid, COLOR_RED, "Das kannst du noch nicht !"); }
	new
	  Float:x,
	  Float:y,
	  Float:z,
	  string[64],
		key[64];
	SendClientMessage(playerid, COLOR_RED, "Speicher Daten...");
	format(string, sizeof(string), "Jobs/%s", JobInfo[playerid][Name]);
	dini_IntSet(string, "Model", JobInfo[playerid][Model]);
	dini_FloatSet(string, "FX", JobInfo[playerid][xx]);
	dini_FloatSet(string, "FY", JobInfo[playerid][yy]);
	dini_FloatSet(string, "FZ", JobInfo[playerid][zz]);
	dini_FloatSet(string, "FR", JobInfo[playerid][rr]);
	dini_IntSet(string, "Color1", JobInfo[playerid][Color1]);
	dini_IntSet(string, "Color2", JobInfo[playerid][Color2]);
	InProcess[playerid] = 0;
	new File:Liste;
	Liste = fopen("Jobs/Liste.txt", io_append);
	format(string,sizeof(string), "|%s|",JobInfo[playerid][Name]);
	fwrite(Liste, string);
	fclose(Liste);
	for(new c = 1; c < 60; c++)
	{
	  if(JobInfo[playerid][Checkpoints_x][c] == 0.0) { return SendClientMessage(playerid, COLOR_RED, "... Daten wurden erfolgreich gespeichert."); }
		x = JobInfo[playerid][Checkpoints_x][c];
		y = JobInfo[playerid][Checkpoints_y][c];
		z = JobInfo[playerid][Checkpoints_z][c];
		format(key, sizeof(key), "Checkpoint_X[%d]", c);
		dini_FloatSet(string, key, x);
		format(key, sizeof(key), "Checkpoint_Y[%d]", c);
		dini_FloatSet(string, key, y);
		format(key, sizeof(key), "Checkpoint_Z[%d]", c);
		dini_FloatSet(string, key, z);
	}
	return 1;
}
If you want the cmd in english, i can translate it, just say anything.
Reply
#2

Take it to the DINI topic.
Reply
#3

I found the mistake.
.cfg is missing after the name:


Код:
format(string, sizeof(string), "Jobs/%s.cfg", JobInfo[playerid][Name]);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)