Bug, housesystem?
#1

If i use:
Код:
new MajaInfo[1][hInfo];
Then work's, if
Код:
new MajaInfo[194][hInfo];
Then doenst work.
Just logging and staying at camera in LS (default), but doenst spawn it...
In console says, it all house's are loaded
Reply
#2

i need to see yr house script
Reply
#3

Код:
enum hInfo
{
	Float:hEntrancex,
	Float:hEntrancey,
	Float:hEntrancez,
	Float:hExitx,
	Float:hExity,
	Float:hExitz,
	hHealthx,
	hHealthy,
	hHealthz,
	hArmourx,
	hArmoury,
	hArmourz,
	hOwner[MAX_PLAYER_NAME],
	hDiscription[MAX_PLAYER_NAME],
	hValue,
	hHel,
	hArm,
	hInt,
	hLock,
	hOwned,
	hRooms,
	hRent,
	hRentabil,
	hTakings,
	hVec,
	hVcol1,
	hVcol2,
	hDate,
	hLevel,
	hWorld
};

new MajaInfo[1][hInfo];
Код:
public LoadProperty()
{
	new arrCoords[30][64];
	new strFromFile2[256];
	new File: file = fopen("/ERP/cfg/property.cfg", io_read);
	if (file)
	{
		new idx;
		while (idx < sizeof(MajaInfo))
		{
			fread(file, strFromFile2);
			split(strFromFile2, arrCoords, ',');
			MajaInfo[idx][hEntrancex] = floatstr(arrCoords[0]);
			MajaInfo[idx][hEntrancey] = floatstr(arrCoords[1]);
			MajaInfo[idx][hEntrancez] = floatstr(arrCoords[2]);
			MajaInfo[idx][hExitx] = floatstr(arrCoords[3]);
			MajaInfo[idx][hExity] = floatstr(arrCoords[4]);
			MajaInfo[idx][hExitz] = floatstr(arrCoords[5]);
			MajaInfo[idx][hHealthx] = strval(arrCoords[6]);
			MajaInfo[idx][hHealthy] = strval(arrCoords[7]);
			MajaInfo[idx][hHealthz] = strval(arrCoords[8]);
			MajaInfo[idx][hArmourx] = strval(arrCoords[9]);
			MajaInfo[idx][hArmoury] = strval(arrCoords[10]);
			MajaInfo[idx][hArmourz] = strval(arrCoords[11]);
			//printf("MajaInfo hEntrancez %f",MajaInfo[idx][hEntrancez]);
			strmid(MajaInfo[idx][hOwner], arrCoords[12], 0, strlen(arrCoords[12]), 255);
			strmid(MajaInfo[idx][hDiscription], arrCoords[13], 0, strlen(arrCoords[13]), 255);
			MajaInfo[idx][hValue] = strval(arrCoords[14]);
			MajaInfo[idx][hHel] = strval(arrCoords[15]);
			MajaInfo[idx][hArm] = strval(arrCoords[16]);
			MajaInfo[idx][hInt] = strval(arrCoords[17]);
			MajaInfo[idx][hLock] = strval(arrCoords[18]);
			MajaInfo[idx][hOwned] = strval(arrCoords[19]);
			MajaInfo[idx][hRooms] = strval(arrCoords[20]);
			MajaInfo[idx][hRent] = strval(arrCoords[21]);
			MajaInfo[idx][hRentabil] = strval(arrCoords[22]);
			MajaInfo[idx][hTakings] = strval(arrCoords[23]);
			MajaInfo[idx][hVec] = strval(arrCoords[24]);
			MajaInfo[idx][hVcol1] = strval(arrCoords[25]);
			MajaInfo[idx][hVcol2] = strval(arrCoords[26]);
			MajaInfo[idx][hDate] = strval(arrCoords[27]);
			MajaInfo[idx][hLevel] = strval(arrCoords[28]);
			MajaInfo[idx][hWorld] = strval(arrCoords[29]);

			printf("MajaInfo:%d Omanik:%s hTakings %d hVec %d",idx,MajaInfo[idx][hOwner],MajaInfo[idx][hTakings],MajaInfo[idx][hVec]);
			idx++;
		}
		fclose(file);
	}
	return 1;
}
Код:
public SetPlayerSpawn(playerid)
{
	if(IsPlayerConnected(playerid))
	{
	  new house = PlayerInfo[playerid][pPhousekey];
	 	if(house !=255)
		{
			if(SpawnChange[playerid])
			{
				SetPlayerToTeamColor(playerid);
				SetPlayerInterior(playerid,MajaInfo[house][hInt]);
				SetPlayerVirtualWorld(playerid,MajaInfo[house][hWorld]);
				SetPlayerPos(playerid, MajaInfo[house][hExitx], MajaInfo[house][hExity],MajaInfo[house][hExitz]);
				PlayerInfo[playerid][pLocal] = house;
				HouseEntered[playerid] = house;
				PlayerInfo[playerid][pInt] = MajaInfo[house][hInt];
				return 1;
			}
		}
 		else
	  {
			SetPlayerToTeamColor(playerid);
			SetPlayerPos(playerid, 1882.8409,2339.1650,10.9799);
			SetPlayerFacingAngle(playerid, 270);
			SetPlayerInterior(playerid,0);
			PlayerInfo[playerid][pInt] = 0;
			return 1;
		}
	}
	return 1;
}
Reply
#4

You also have to set the house vehicles to 194
Reply
#5

Quote:
Originally Posted by WackoX
You also have to set the house vehicles to 194
What house vehicles?
I dont use house vehicle's.
Reply
#6

case close! property.cfg was theres mistakes
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)