Dynamic Job doesn't want to load
#1

Title really says it all.. it's the exrpr46 script and the dynamic jobs don't want to load... any solutions?

Код:
LoadDynamicJobs()
{
	new arrCoords[6][64];
	new strFromFile2[256];
	new File: file = fopen("jobs.cfg", io_read);
	if (file)
	print("Loaded jobs");
	{
		new idx;
		while (idx < MAX_JOBS)
		{
			fread(file, strFromFile2);
			splits(strFromFile2, arrCoords, '|');
	  		JobInfo[idx][jobX] = floatstr(arrCoords[0]);
	  		JobInfo[idx][jobY] = floatstr(arrCoords[1]);
	  		JobInfo[idx][jobZ] = floatstr(arrCoords[2]);
			JobInfo[idx][jobType] = strval(arrCoords[3]);
	  		JobInfo[idx][jobVW] = strval(arrCoords[4]);
	  		JobInfo[idx][jobInt] = strval(arrCoords[5]);

            if(JobInfo[idx][jobX] != 0 && JobInfo[idx][jobY] != 0 && JobInfo[idx][jobZ] != 0)
	  		{
	  		    CreateDynamicJob(idx);
			}
			
			idx++;
		}
		fclose(file);
	}
	return 1;
}
Код:
SaveDynamicJobs(){

	new
		szFileStr[1024],
		File: fHandle = fopen("jobs.cfg", io_write);

	for(new iIndex; iIndex < MAX_LOCKERS; iIndex++) {
		format(szFileStr, sizeof(szFileStr), "%f|%f|%f|%d|%d|%d\r\n",
			JobInfo[iIndex][jobX],
			JobInfo[iIndex][jobY],
			JobInfo[iIndex][jobZ],
			JobInfo[iIndex][jobType],
			JobInfo[iIndex][jobVW],
			JobInfo[iIndex][jobInt]
		);
		fwrite(fHandle, szFileStr);
	}
	return fclose(fHandle);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)