SA-MP Forums Archive
Problem to Load Files - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem to Load Files (/showthread.php?tid=196977)



Problem to Load Files - Xivop. - 07.12.2010

Hey Guys, i have a problem.

My Script load the property.cfg, but i can only Press ENTER at the First Property.

Here my Code :

Код:
public OeffentlicheLaden()
{
	new arrCoords[30][64];
	new strFromFile2[256];
	new File: file = fopen("property.cfg", io_read);
	if (file)
	{
		new idx;
		while (idx < sizeof(sHausInfo))
		{
			fread(file, strFromFile2);
			split(strFromFile2, arrCoords, ',');
			sHausInfo[idx][sEingangX] = floatstr(arrCoords[0]);
			sHausInfo[idx][sEingangY] = floatstr(arrCoords[1]);
			sHausInfo[idx][sEingangZ] = floatstr(arrCoords[2]);
			sHausInfo[idx][sAusgangX] = floatstr(arrCoords[3]);
			sHausInfo[idx][sAusgangY] = floatstr(arrCoords[4]);
			sHausInfo[idx][sAusgangZ] = floatstr(arrCoords[5]);
			sHausInfo[idx][sInterior] = strval(arrCoords[6]);
			idx++;
		}
		printf("[SCRIPT]: Geladen wurden %d Oeffentliche Gebaeude", idx);
		fclose(file);
	}
	return 1;
}
Here my Property.cfg

Код:
-1749.3296,871.5529,25.0859,1710.433715,-1669.379272,20.225049,18
-1783.0131,572.4954,35.1641,2315.952880,-1.618174,26.742187,0
And now my ENTER Code :

Код:
if(IsPlayerConnected(playerid))
		{
        for(new i = 0; i < sizeof(sHausInfo); i++)
			{
			if (newkeys & KEY_SECONDARY_ATTACK)
				{
				if(IsPlayerInRangeOfPoint(playerid,3,sHausInfo[playerid][sEingangX], sHausInfo[playerid][sEingangY], sHausInfo[playerid][sEingangZ]))
					{
					SetPlayerPos(playerid,sHausInfo[playerid][sAusgangX],sHausInfo[playerid][sAusgangY],sHausInfo[playerid][sAusgangZ]);
					SetPlayerInterior(playerid,sHausInfo[playerid][sInterior]);
					}
				else if(IsPlayerInRangeOfPoint(playerid,3,sHausInfo[playerid][sAusgangX],sHausInfo[playerid][sAusgangY],sHausInfo[playerid][sAusgangZ]))
					{
		    		SetPlayerPos(playerid,sHausInfo[playerid][sEingangX], sHausInfo[playerid][sEingangY], sHausInfo[playerid][sEingangZ]);
		    		sHausInfo[playerid][sInterior] = 0;
		    		SetPlayerInterior(playerid,0);
				}
			}
		}
	}
My next Problem :
I go into the Propertys, and come in. But if i leave the Property, i come out. So no problem :b
But if i try to go next time into the Property, iam falling down. Why ? Every time ?