Добро пожаловать на Pro Pawn - Портал о PAWN-скриптинге.

Реклама


**Как получить V.I.P** (Перейти)
Чтобы заказать рекламу на Pro-Pawn.Ru, обращайтесь в Skype.
Баннерная реклама 200руб/мес, Текстовая 100руб/мес.
Показано с 1 по 2 из 2
  1. #1
    Аватар для Alex_Smith
    Пользователь

    Статус
    Оффлайн
    Регистрация
    09.04.2015
    Сообщений
    1
    Репутация:
    0 ±

    Система домов

    Проблема вот в чем,я ставлю дом(все норм и иконки и т.д)но после выключения и включения мода иконка дома проподает (если подойти туда куда поставил и нажат опр кнопку то можно купить).В чем может быть проблемма?

    Это команды:
    Код HTML:
    	else if(!strcmp(cmd, "/asethouse", true))
    	{
    		if(PlayerInfo[playerid][pAdmin] < 10) return MSG_NOADMIN2(playerid);
    		new price,Float:POS[4];
    		LastHouse += 1;
    		switch(random(2))
    		{
    		case 0: price = 440000;
    		case 1: price = 430000;
            }
    		HouseInfo[LastHouse][hLevel] = 1;
    		HouseInfo[LastHouse][hInterior] = 3;
    		HouseInfo[LastHouse][hCost] = price;
    		GetPlayerPos(playerid, POS[0], POS[1], POS[2]);
    		GetPlayerFacingAngle(playerid, POS[3]);
    		HouseInfo[LastHouse][hEnterX] = POS[0];
    		HouseInfo[LastHouse][hEnterY] = POS[1];
    		HouseInfo[LastHouse][hEnterZ] = POS[2];
    		GetXYInFrontOfPlayer(playerid, POS[0], POS[1], -2.5);
    		HouseInfo[LastHouse][hSpawnX] = POS[0];
    		HouseInfo[LastHouse][hSpawnY] = POS[1];
    		HouseInfo[LastHouse][hSpawnZ] = POS[2];
    		HouseInfo[LastHouse][hSpawnA] = POS[3]+180;
    		settext(HouseInfo[LastHouse][hOwner], "None");
    		settext(HouseInfo[LastHouse][hName], "None");
    		HouseIcon[LastHouse] = CreateDynamicMapIcon(HouseInfo[LastHouse][hEnterX], HouseInfo[LastHouse][hEnterY], HouseInfo[LastHouse][hEnterZ], 31, 0, 0, 0, -1, 50.0);
    		HousePickupOut[LastHouse] = CreateDynamicPickup(1273, 23, HouseInfo[LastHouse][hEnterX], HouseInfo[LastHouse][hEnterY], HouseInfo[LastHouse][hEnterZ]);
    		CreateHouseExitPickup(LastHouse);
    		f(string, "Äîì íîìåð {CCCCCC}%d{FFFFFF} óñïåøíî ñîçäàí", LastHouse);
    		SendClientMessage(playerid, COLOR_WHITE, string);
    		SaveHouses();
    		return true;
    	}
    	else if(!strcmp(cmd, "/bsethouse", true))
    	{
    		if(PlayerInfo[playerid][pAdmin] < 10) return MSG_NOADMIN4(playerid);
    		new price,Float:POS[4];
    		LastHouse += 1;
    		switch(random(2))
    		{
    		case 0: price = 360000;
    		case 1: price = 375000;
        	}
    		HouseInfo[LastHouse][hLevel] = 1;
    		HouseInfo[LastHouse][hInterior] = 2;
    		HouseInfo[LastHouse][hCost] = price;
    		GetPlayerPos(playerid, POS[0], POS[1], POS[2]);
    		GetPlayerFacingAngle(playerid, POS[3]);
    		HouseInfo[LastHouse][hEnterX] = POS[0];
    		HouseInfo[LastHouse][hEnterY] = POS[1];
    		HouseInfo[LastHouse][hEnterZ] = POS[2];
    		GetXYInFrontOfPlayer(playerid, POS[0], POS[1], -2.5);
    		HouseInfo[LastHouse][hSpawnX] = POS[0];
    		HouseInfo[LastHouse][hSpawnY] = POS[1];
    		HouseInfo[LastHouse][hSpawnZ] = POS[2];
    		HouseInfo[LastHouse][hSpawnA] = POS[3]+180;
    		settext(HouseInfo[LastHouse][hOwner], "None");
    		settext(HouseInfo[LastHouse][hName], "None");
    		HouseIcon[LastHouse] = CreateDynamicMapIcon(HouseInfo[LastHouse][hEnterX], HouseInfo[LastHouse][hEnterY], HouseInfo[LastHouse][hEnterZ], 31, 0, 0, 0, -1, 50.0);
    		HousePickupOut[LastHouse] = CreateDynamicPickup(1273, 23, HouseInfo[LastHouse][hEnterX], HouseInfo[LastHouse][hEnterY], HouseInfo[LastHouse][hEnterZ]);
    		CreateHouseExitPickup(LastHouse);
    		f(string, "Äîì íîìåð {CCCCCC}%d{FFFFFF} óñïåøíî ñîçäàí", LastHouse);
    		SendClientMessage(playerid, COLOR_WHITE, string);
    		SaveHouses();
    		return true;
    	}
    	else if(!strcmp(cmd, "/csethouse", true))
    	{
    		if(PlayerInfo[playerid][pAdmin] < 10) return MSG_NOADMIN2(playerid);
    		new price,Float:POS[4];
    		LastHouse += 1;
    		switch(random(10))
    		{
    		case 0: price = 210000;
    		case 1: price = 250000;
    		case 2: price = 230000;
    		case 3: price = 260000;
    		case 4: price = 265000;
    		case 5: price = 275000;
    		case 6: price = 255000;
    		case 7: price = 240000;
    		case 8: price = 240500;
    		case 9: price = 210000;
    		case 10: price = 200000;
    		}
    		HouseInfo[LastHouse][hLevel] = 1;
    		HouseInfo[LastHouse][hInterior] = 4;
    		HouseInfo[LastHouse][hCost] = price;
    		GetPlayerPos(playerid, POS[0], POS[1], POS[2]);
    		GetPlayerFacingAngle(playerid, POS[3]);
    		HouseInfo[LastHouse][hEnterX] = POS[0];
    		HouseInfo[LastHouse][hEnterY] = POS[1];
    		HouseInfo[LastHouse][hEnterZ] = POS[2];
    		GetXYInFrontOfPlayer(playerid, POS[0], POS[1], -2.5);
    		HouseInfo[LastHouse][hSpawnX] = POS[0];
    		HouseInfo[LastHouse][hSpawnY] = POS[1];
    		HouseInfo[LastHouse][hSpawnZ] = POS[2];
    		HouseInfo[LastHouse][hSpawnA] = POS[3]+180;
    		settext(HouseInfo[LastHouse][hOwner], "None");
    		settext(HouseInfo[LastHouse][hName], "None");
    		HouseIcon[LastHouse] = CreateDynamicMapIcon(HouseInfo[LastHouse][hEnterX], HouseInfo[LastHouse][hEnterY], HouseInfo[LastHouse][hEnterZ], 31, 0, 0, 0, -1, 50.0);
    		HousePickupOut[LastHouse] = CreateDynamicPickup(1273, 23, HouseInfo[LastHouse][hEnterX], HouseInfo[LastHouse][hEnterY], HouseInfo[LastHouse][hEnterZ]);
    		CreateHouseExitPickup(LastHouse);
    		f(string, "Äîì íîìåð {CCCCCC}%d{FFFFFF} óñïåøíî ñîçäàí", LastHouse);
    		SendClientMessage(playerid, COLOR_WHITE, string);
    		SaveHouses();
    		return true;
    	}
    	else if(!strcmp(cmd, "/nsethouse", true))
    	{
    		if(PlayerInfo[playerid][pAdmin] < 10) return MSG_NOADMIN2(playerid);
    		new price,Float:POS[4];
    		LastHouse += 1;
    		switch(random(2))
    		{
    		case 0: price = 130000;
    		case 1: price = 140000;
            }
    		HouseInfo[LastHouse][hLevel] = 1;
    		HouseInfo[LastHouse][hInterior] = 1;
    		HouseInfo[LastHouse][hCost] = price;
    		GetPlayerPos(playerid, POS[0], POS[1], POS[2]);
    		GetPlayerFacingAngle(playerid, POS[3]);
    		HouseInfo[LastHouse][hEnterX] = POS[0];
    		HouseInfo[LastHouse][hEnterY] = POS[1];
    		HouseInfo[LastHouse][hEnterZ] = POS[2];
    		GetXYInFrontOfPlayer(playerid, POS[0], POS[1], -2.5);
    		HouseInfo[LastHouse][hSpawnX] = POS[0];
    		HouseInfo[LastHouse][hSpawnY] = POS[1];
    		HouseInfo[LastHouse][hSpawnZ] = POS[2];
    		HouseInfo[LastHouse][hSpawnA] = POS[3]+180;
    		settext(HouseInfo[LastHouse][hOwner], "None");
    		settext(HouseInfo[LastHouse][hName], "None");
    		HouseIcon[LastHouse] = CreateDynamicMapIcon(HouseInfo[LastHouse][hEnterX], HouseInfo[LastHouse][hEnterY], HouseInfo[LastHouse][hEnterZ], 31, 0, 0, 0, -1, 50.0);
    		HousePickupOut[LastHouse] = CreateDynamicPickup(1273, 23, HouseInfo[LastHouse][hEnterX], HouseInfo[LastHouse][hEnterY], HouseInfo[LastHouse][hEnterZ]);
    		CreateHouseExitPickup(LastHouse);
    		f(string, "Äîì íîìåð {CCCCCC}%d{FFFFFF} óñïåøíî ñîçäàí", LastHouse);
    		SendClientMessage(playerid, COLOR_WHITE, string);
    		SaveHouses();
    		return true;
    	}
    Это загрузка и сохранения домов:
    Код HTML:
    stock LoadHouses()
    {
    	if(!fexist("houses.cfg")) return printf("file 'houses.cfg' not found");
    	new arrCoords[23][64],strFromFile[256],i;
    	new File:GetFile = fopen("houses.cfg");
    	while(fread(GetFile, strFromFile))
    	{
    		if(!strlen(strFromFile)) break;
    		i += 1;
    		split(strFromFile, arrCoords, '|');
    		settext(HouseInfo[i][hName], arrCoords[0]);
    		settext(HouseInfo[i][hOwner], arrCoords[1]);
    		HouseInfo[i][hLevel] = strval(arrCoords[2]);
    		HouseInfo[i][hCost] = strval(arrCoords[3]);
    		HouseInfo[i][hInterior] = strval(arrCoords[4]);
    		HouseInfo[i][hEnterX] = floatstr(arrCoords[5]);
    		HouseInfo[i][hEnterY] = floatstr(arrCoords[6]);
    		HouseInfo[i][hEnterZ] = floatstr(arrCoords[7]);
    		HouseInfo[i][hSpawnX] = floatstr(arrCoords[8]);
    		HouseInfo[i][hSpawnY] = floatstr(arrCoords[9]);
    		HouseInfo[i][hSpawnZ] = floatstr(arrCoords[10]);
    		HouseInfo[i][hSpawnA] = floatstr(arrCoords[11]);
    		HouseInfo[i][hCarID] = strval(arrCoords[12]);
    		HouseInfo[i][hColor] = strval(arrCoords[13]);
    		HouseInfo[i][hCarX] = floatstr(arrCoords[14]);
    		HouseInfo[i][hCarY] = floatstr(arrCoords[15]);
    		HouseInfo[i][hCarZ] = floatstr(arrCoords[16]);
    		HouseInfo[i][hCarA] = floatstr(arrCoords[17]);
    		HouseInfo[i][hHealth] = strval(arrCoords[18]);
    		HouseInfo[i][hMoneys] = strval(arrCoords[19]);
    		HouseInfo[i][hClooth] = strval(arrCoords[20]);
    		HouseInfo[i][hSave] = strval(arrCoords[21]);
    		HouseInfo[i][hDoors] = strval(arrCoords[22]);
    		if(HouseInfo[i][hCarID] < 400) continue;
    		if(!strcmp(HouseInfo[i][hOwner], "None", true))
    		{
    			HouseIcon[i] = CreateDynamicMapIcon(HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ], 31, 0, 0, 0, -1, 150.0);
    			HousePickupOut[i] = CreateDynamicPickup(1273, 23, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]);
    		}
    		else
    		{
    			HouseIcon[i] = CreateDynamicMapIcon(HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ], 32, 0, 0, 0, -1, 150.0);
    			HousePickupOut[i] = CreateDynamicPickup(1272, 23, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]);
    		}
    		HouseVehicle[i] = CreateVehicle(HouseInfo[i][hCarID], HouseInfo[i][hCarX], HouseInfo[i][hCarY], HouseInfo[i][hCarZ], HouseInfo[i][hCarA], HouseInfo[i][hColor], HouseInfo[i][hColor], -1);
    		GetVehicleHouse[HouseVehicle[i]] = i;
    		SetVehicleToRespawn(HouseVehicle[i]);
    		CreateHouseExitPickup(i);
    		HouseOpen[i] = false;
    	}
    	fclose(GetFile);
    	LastHouse = i;
    	return true;
    }
    ////вот еще сохранение домов////
    stock SaveHouses()
    {
    	if(!fexist("houses.cfg")) return printf("file 'houses.cfg' not found");
    	new string[256],File:GetFile = fopen("houses.cfg", io_write);
    	for(new i=1; i<LastHouse+1; i++)
    	{
    		if(HouseInfo[i][hCost] == 0) continue;
    		f(string, "%s|%s|%d|%d|%d|%f|%f|%f|%f|%f|%f|%f|%d|%d|%f|%f|%f|%f|%d|%d|%d|%d|%d\n",
    		HouseInfo[i][hName],
    		HouseInfo[i][hOwner],
    		HouseInfo[i][hLevel],
    		HouseInfo[i][hCost],
    		HouseInfo[i][hInterior],
    		HouseInfo[i][hEnterX],
    		HouseInfo[i][hEnterY],
    		HouseInfo[i][hEnterZ],
    		HouseInfo[i][hSpawnX],
    		HouseInfo[i][hSpawnY],
    		HouseInfo[i][hSpawnZ],
    		HouseInfo[i][hSpawnA],
    		HouseInfo[i][hCarID],
    		HouseInfo[i][hColor],
    		HouseInfo[i][hCarX],
    		HouseInfo[i][hCarY],
    		HouseInfo[i][hCarZ],
    		HouseInfo[i][hCarA],
    		HouseInfo[i][hHealth],
    		HouseInfo[i][hMoneys],
    		HouseInfo[i][hClooth],
    		HouseInfo[i][hSave],
    		HouseInfo[i][hDoors]);
    		fwrite(GetFile, string);
    	}
    	fclose(GetFile);
    	return true;
    }

  2. #2
    Аватар для Shayba
    Пользователь

    Статус
    Оффлайн
    Регистрация
    11.10.2014
    Сообщений
    191
    Репутация:
    19 ±
    Может попробовать в папке scriptfiles создать папку house?
    Что бы домам было где сохранятся.

 

 

Информация о теме

Пользователи, просматривающие эту тему

Эту тему просматривают: 1 (пользователей: 0 , гостей: 1)

Ваши права

  • Вы не можете создавать новые темы
  • Вы не можете отвечать в темах
  • Вы не можете прикреплять вложения
  • Вы не можете редактировать свои сообщения
  •