Points not loading correctly?
#1

Okay Ive nearly got my points system working but i'm having trouble with how its loading. I've got:

Код:
public LoadPoints()
{
	new arrCoords[8][64];
	new strFromFile2[256];
	new File: file = fopen("AUSRP/Points/points.cfg", io_read);
	if (file)
	{
		new idx;
		while (idx < sizeof(Points))
		{
			fread(file, strFromFile2);
			split(strFromFile2, arrCoords, '|');
			Points[idx][Pointx] = floatstr(arrCoords[0]);
			Points[idx][Pointy] = floatstr(arrCoords[1]);
			Points[idx][Pointz] = floatstr(arrCoords[2]);
			Points[idx][Type] = strval(arrCoords[3]);
			Points[idx][Vulnerable] = strval(arrCoords[4]);
			strmid(Points[idx][Owner], arrCoords[5], 0, strlen(arrCoords[5]), 255);
			strmid(Points[idx][Name], arrCoords[6], 0, strlen(arrCoords[6]), 255);
			Points[idx][MatPoint] = strval(arrCoords[7]);
			printf("Point:%s Type:%d Owner:%s",Points[idx][Name],Points[idx][Type],Points[idx][Owner]);
			idx++;
		}
		fclose(file);
	}
	return 1;
}
And in my points.cfg folder:

683.4438|-1435.6627|14.8516|1|0|yes|Mat Point 1|1
2481.1733|-1331.8589|28.2338|1|0|yes|Mat Point 2|2
534.2418|-1813.0688|6.5781|1|0|yes|Mat Point 3|3
215.1355|-229.9074|1.7786|2|0|yes|Mat Deliver 1|4
2140.0894|-2271.5725|17.5625|2|0|yes|Mat Deliver 2|5
-1134.6433|-1095.3339|128.9231|2|0|yes|Mat Deliver 3|6
1083.9131|-1226.5756|15.8203|3|0|yes|Drug Point 1|7
1966.9735|-1176.2975|20.0307|3|0|yes|Drug Point 2|8
2871.0530|-2124.7024|4.8557|3|0|yes|Drug Point 3|9

When I start server it shows up as:



It should show as:

Point: Mat Point 1 Type: 1 Owner: yes
Point: Mat Point 2 Type: 1 Owner: yes
Point: Mat Point 3 Type: 1 Owner: yes
Point: Mat Deliver 1 Type: 2 Owner: yes
Point: Mat Deliver 2 Type: 2 Owner: yes
Point: Mat Deliver 3 Type: 2 Owner: yes
Point: Drug Point 1 Type : 3 Owner: yes
Point: Drug Point 2 Type: 3 Owner: yes
Point: Drug Point 3 Type: 3 Owner: yes
Reply
#2

Anyone?
Reply
#3

Why not just use dini ? Way easier, plus easier to load too.
Reply
#4

Quote:
Originally Posted by cmg4life
Why not just use dini ? Way easier, plus easier to load too.
Is there an example of how to load with dini around?
Reply
#5

Anyone want to help with this?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)