Если Вы нашли ответ на вопрос, пожалуйста, пометьте необходимый ответ лучшим (галочка сбоку от сообщения) и поблагодарите автора этого ответа поднятием репутации (плюс в нижней правой части сообщения). Спасибо.
Подробнее:
FAQ по форуму
Как пометить ответ лучшим

Question

Помогите у меня почему то после рестарта проподает тюнинг на машинах

P.S какие надо скрипты не знаю, напишите скину

Share this post


Link to post

21 answers to this question

  • 0

Если не сохраняется тюнинг, вероянто, нет сохранения. 

Тюнинг идет в скрипте или в моде?

Share this post


Link to post
  • 0

@DEST Да, но инструменты, покраска для гаража сахраняется все, а на машину нет

Share this post


Link to post
  • 0

@Daniil Roslyakov Если тюнинг в моде, тогда на него нужно писать сохранение. Если тюнинг в скрипте, тогда найдите скрипт с уже написанным сохранением. 

Share this post


Link to post
  • 0

@DEST 

stock SaveVehicleTuning(playerid)
{
	if(GetPlayerVehicleID(playerid) != PI[playerid][PlayerCarID][0] && GetPlayerVehicleID(playerid) != PI[playerid][PlayerCarID][1]) return SCM(playerid,COLOR_GREY,"Прозошла ошибка при сохранение тюнинга.");
	new slot;
	if(GetPlayerVehicleID(playerid) == PI[playerid][PlayerCarID][0]) slot = 0;
	if(GetPlayerVehicleID(playerid) == PI[playerid][PlayerCarID][1]) slot = 1;
	
	if(slot == 0)
	{
		cVehcoms1[playerid][0] = GetVehicleComponentInSlot(PI[playerid][PlayerCarID][slot], CARMODTYPE_SPOILER);
		cVehcoms1[playerid][1] = GetVehicleComponentInSlot(PI[playerid][PlayerCarID][slot], CARMODTYPE_HOOD);
		cVehcoms1[playerid][2] = GetVehicleComponentInSlot(PI[playerid][PlayerCarID][slot], CARMODTYPE_ROOF);
		cVehcoms1[playerid][3] = GetVehicleComponentInSlot(PI[playerid][PlayerCarID][slot], CARMODTYPE_SIDESKIRT);
		cVehcoms1[playerid][4] = GetVehicleComponentInSlot(PI[playerid][PlayerCarID][slot], CARMODTYPE_LAMPS);
		cVehcoms1[playerid][5] = GetVehicleComponentInSlot(PI[playerid][PlayerCarID][slot], CARMODTYPE_NITRO);
		cVehcoms1[playerid][6] = GetVehicleComponentInSlot(PI[playerid][PlayerCarID][slot], CARMODTYPE_EXHAUST);
		cVehcoms1[playerid][7] = GetVehicleComponentInSlot(PI[playerid][PlayerCarID][slot], CARMODTYPE_WHEELS);
		cVehcoms1[playerid][8] = GetVehicleComponentInSlot(PI[playerid][PlayerCarID][slot], CARMODTYPE_STEREO);
		cVehcoms1[playerid][9] = GetVehicleComponentInSlot(PI[playerid][PlayerCarID][slot], CARMODTYPE_HYDRAULICS);
		cVehcoms1[playerid][10] = GetVehicleComponentInSlot(PI[playerid][PlayerCarID][slot], CARMODTYPE_FRONT_BUMPER);
		cVehcoms1[playerid][11] = GetVehicleComponentInSlot(PI[playerid][PlayerCarID][slot], CARMODTYPE_REAR_BUMPER);
		cVehcoms1[playerid][12] = GetVehicleComponentInSlot(PI[playerid][PlayerCarID][slot], CARMODTYPE_VENT_RIGHT);
		cVehcoms1[playerid][13] = GetVehicleComponentInSlot(PI[playerid][PlayerCarID][slot], CARMODTYPE_VENT_LEFT);
		
		new string[128];
		f(string,"%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",
		cVehcoms1[playerid][0], cVehcoms1[playerid][1], cVehcoms1[playerid][2],
		cVehcoms1[playerid][3], cVehcoms1[playerid][4], cVehcoms1[playerid][5],
		cVehcoms1[playerid][6], cVehcoms1[playerid][7], cVehcoms1[playerid][8],
		cVehcoms1[playerid][9], cVehcoms1[playerid][10], cVehcoms1[playerid][11],
		cVehcoms1[playerid][12], cVehcoms1[playerid][13]);
		settext(cVehcom1[playerid],string);
	}
	else
	{
	    cVehcoms2[playerid][0] = GetVehicleComponentInSlot(PI[playerid][PlayerCarID][slot], CARMODTYPE_SPOILER);
		cVehcoms2[playerid][1] = GetVehicleComponentInSlot(PI[playerid][PlayerCarID][slot], CARMODTYPE_HOOD);
		cVehcoms2[playerid][2] = GetVehicleComponentInSlot(PI[playerid][PlayerCarID][slot], CARMODTYPE_ROOF);
		cVehcoms2[playerid][3] = GetVehicleComponentInSlot(PI[playerid][PlayerCarID][slot], CARMODTYPE_SIDESKIRT);
		cVehcoms2[playerid][4] = GetVehicleComponentInSlot(PI[playerid][PlayerCarID][slot], CARMODTYPE_LAMPS);
		cVehcoms2[playerid][5] = GetVehicleComponentInSlot(PI[playerid][PlayerCarID][slot], CARMODTYPE_NITRO);
		cVehcoms2[playerid][6] = GetVehicleComponentInSlot(PI[playerid][PlayerCarID][slot], CARMODTYPE_EXHAUST);
		cVehcoms2[playerid][7] = GetVehicleComponentInSlot(PI[playerid][PlayerCarID][slot], CARMODTYPE_WHEELS);
		cVehcoms2[playerid][8] = GetVehicleComponentInSlot(PI[playerid][PlayerCarID][slot], CARMODTYPE_STEREO);
		cVehcoms2[playerid][9] = GetVehicleComponentInSlot(PI[playerid][PlayerCarID][slot], CARMODTYPE_HYDRAULICS);
		cVehcoms2[playerid][10] = GetVehicleComponentInSlot(PI[playerid][PlayerCarID][slot], CARMODTYPE_FRONT_BUMPER);
		cVehcoms2[playerid][11] = GetVehicleComponentInSlot(PI[playerid][PlayerCarID][slot], CARMODTYPE_REAR_BUMPER);
		cVehcoms2[playerid][12] = GetVehicleComponentInSlot(PI[playerid][PlayerCarID][slot], CARMODTYPE_VENT_RIGHT);
		cVehcoms2[playerid][13] = GetVehicleComponentInSlot(PI[playerid][PlayerCarID][slot], CARMODTYPE_VENT_LEFT);
		
        new string[128];
		f(string,"%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",
		cVehcoms2[playerid][0], cVehcoms2[playerid][1], cVehcoms2[playerid][2],
		cVehcoms2[playerid][3], cVehcoms2[playerid][4], cVehcoms2[playerid][5],
		cVehcoms2[playerid][6], cVehcoms2[playerid][7], cVehcoms2[playerid][8],
		cVehcoms2[playerid][9], cVehcoms2[playerid][10], cVehcoms2[playerid][11],
		cVehcoms2[playerid][12], cVehcoms2[playerid][13]);
		settext(cVehcom2[playerid],string);
	}
	return 1;
}

Edited by stibs
Причина: spoiler

Share this post


Link to post
  • 0

Где этот сток вызывается?

 

Share this post


Link to post
  • 0

@stibs 

		case D_CTO+5: // CTO
		{
			if(!response) return ShowSTODialog(playerid);
			new i = GetPVarInt(playerid,"CTObizzid");
			new till = BizzInfo[i][bTill];
			switch(listitem)
			{
			case 0:
				{
					if(GetMoney(playerid) < till*80) return SCM(playerid, COLOR_GREY, "Íåäîñòàòî÷íî ñðåäñòâ!"),ShowSTODialog(playerid);
					TransferMoney(playerid, -1, till*80);
					if(BizzInfo[i][bProduct] > 0)
					{
						BizzInfo[i][bMoney] += till*80;
						BizzInfo[i][bProduct] -= 80;
						BizzPay[i] += till*80;
						MysqlUpdateBizzInt(i, "money", BizzInfo[i][bMoney]);
						MysqlUpdateBizzInt(i, "product", BizzInfo[i][bProduct]);
					}
					SendMes(playerid,COLOR_GREEN,"Âû ïîñòàâèëè Nitro x2 çà %d ðóá", till*80);
					AddVehicleComponent(GetPlayerVehicleID(playerid),1009);
					SaveVehicleTuning(playerid);
				}
			case 1:
				{
					if(GetMoney(playerid) < till*150) return SCM(playerid, COLOR_GREY, "Íåäîñòàòî÷íî ñðåäñòâ!"),ShowSTODialog(playerid);
					TransferMoney(playerid, -1, till*150);
					if(BizzInfo[i][bProduct] > 0)
					{
						BizzInfo[i][bMoney] += till*150;
						BizzInfo[i][bProduct] -= 150;
						BizzPay[i] += till*150;
						MysqlUpdateBizzInt(i, "money", BizzInfo[i][bMoney]);
						MysqlUpdateBizzInt(i, "product", BizzInfo[i][bProduct]);
					}
					SendMes(playerid,COLOR_GREEN,"Âû ïîñòàâèëè Nitro x5 çà %d ðóá", till*150);
					AddVehicleComponent(GetPlayerVehicleID(playerid),1008);
					SaveVehicleTuning(playerid);
				}
			case 2:
				{
					if(GetMoney(playerid) < till*300) return SCM(playerid, COLOR_GREY, "Íåäîñòàòî÷íî ñðåäñòâ!"),ShowSTODialog(playerid);
					TransferMoney(playerid, -1, till*300);
					if(BizzInfo[i][bProduct] > 0)
					{
						BizzInfo[i][bMoney] += till*300;
						BizzInfo[i][bProduct] -= 300;
						BizzPay[i] += till*300;
						MysqlUpdateBizzInt(i, "money", BizzInfo[i][bMoney]);
						MysqlUpdateBizzInt(i, "product", BizzInfo[i][bProduct]);
					}
					SendMes(playerid,COLOR_GREEN,"Âû ïîñòàâèëè Nitro x10 çà %d ðóá", till*300);
					AddVehicleComponent(GetPlayerVehicleID(playerid),1010);
					SaveVehicleTuning(playerid);
				}
			}
			ShowSTODialog(playerid);
		}


		case D_CTO+3: // CTO
		{
			if(!response) return ShowSTODialog(playerid);
			new i = GetPVarInt(playerid,"CTObizzid");
			new till = BizzInfo[i][bTill];
			if(GetVehicleComponentInSlot(GetPlayerVehicleID(playerid),CARMODTYPE_HYDRAULICS) != 1087)
			{
				if(GetMoney(playerid) < till*100) return SCM(playerid, COLOR_GREY, "Íåäîñòàòî÷íî ñðåäñòâ!"),ShowSTODialog(playerid);
				TransferMoney(playerid, -1, till*100);
				if(BizzInfo[i][bProduct] > 0)
				{
					BizzInfo[i][bMoney] += till*100;
					BizzInfo[i][bProduct] -= 100;
					BizzPay[i] += till*100;
					MysqlUpdateBizzInt(i, "money", BizzInfo[i][bMoney]);
					MysqlUpdateBizzInt(i, "product", BizzInfo[i][bProduct]);
				}
				SCM(playerid,COLOR_GREEN,"Âû ïîñòàâèëè ãèäðàâëèêó!");
				AddVehicleComponent(GetPlayerVehicleID(playerid),1087);
			}
			else
			{
				SCM(playerid,COLOR_RED,"Âû óäàëèëè ãèäðàâëèêó!");
				RemoveVehicleComponent(GetPlayerVehicleID(playerid),1087);
			}
			SaveVehicleTuning(playerid);
			ShowSTODialog(playerid);
		}



		case D_CTO+13:
		{
			new i = GetPVarInt(playerid,"CTObizzid");
			if(response)
			{
	            if(GetPlayerVehicleID(playerid) != PI[playerid][PlayerCarID][0] && GetPlayerVehicleID(playerid) != PI[playerid][PlayerCarID][1]) return SCM(playerid,COLOR_GREY,"Âû äîëæíû íàõîäèòüñÿ â ëè÷íîì àâòîìîáèëå.");
				new slot;
	            if(GetPlayerVehicleID(playerid) == PI[playerid][PlayerCarID][0]) slot = 0;
	            if(GetPlayerVehicleID(playerid) == PI[playerid][PlayerCarID][1]) slot = 1;
				TransferMoney(playerid, -1, GetPVarInt(playerid,"PriceCTO"));
				if(BizzInfo[i][bProduct] > 0)
				{
					BizzInfo[i][bMoney] += GetPVarInt(playerid,"PriceCTO");
					BizzInfo[i][bProduct] -= GetPVarInt(playerid,"ProductCTO");
					BizzPay[i] += GetPVarInt(playerid,"PriceCTO");
					MysqlUpdateBizzInt(i, "money", BizzInfo[i][bMoney]);
					MysqlUpdateBizzInt(i, "product", BizzInfo[i][bProduct]);
				}
				SendMes(playerid,COLOR_GREEN,"Âû îïëàòèëè %d ðóá çà ïîêðàñî÷íóþ ðàáîòó", GetPVarInt(playerid,"PriceCTO"));
				cPaintjob[playerid][slot] = GetPVarInt(playerid,"PaintjobCTO");
				SaveVehicleTuning(playerid);
				ShowSTODialog(playerid);
			}
			else
			{
			    if(GetPlayerVehicleID(playerid) != PI[playerid][PlayerCarID][0] && GetPlayerVehicleID(playerid) != PI[playerid][PlayerCarID][1]) return SCM(playerid,COLOR_GREY,"Âû äîëæíû íàõîäèòüñÿ â ëè÷íîì àâòîìîáèëå.");
			    new slot;
	            if(GetPlayerVehicleID(playerid) == PI[playerid][PlayerCarID][0]) slot = 0;
	            if(GetPlayerVehicleID(playerid) == PI[playerid][PlayerCarID][1]) slot = 1;
				if(cPaintjob[playerid][slot] != 3) ChangeVehiclePaintjob(GetPlayerVehicleID(playerid),cPaintjob[playerid][slot]);
				else
				{
					ChangeVehiclePaintjob(GetPlayerVehicleID(playerid),3);
					ChangeVehicleColor(GetPlayerVehicleID(playerid), cColor0[playerid][slot], cColor1[playerid][slot]);
				}
				SCM(playerid,COLOR_RED,"Âû îòìåíèëè ïîêóïêó");
				SaveVehicleTuning(playerid);
				ShowSTODialog(playerid);
			}
		}
                      
                      
                      
		case D_CTO+12: // CTO
		{
			new i = GetPVarInt(playerid,"CTObizzid");
			if(response)
			{
				TransferMoney(playerid, -1, GetPVarInt(playerid,"PriceCTO"));
				if(BizzInfo[i][bProduct] > 0)
				{
					BizzInfo[i][bMoney] += GetPVarInt(playerid,"PriceCTO");
					BizzInfo[i][bProduct] -= GetPVarInt(playerid,"ProductCTO");
					BizzPay[i] += GetPVarInt(playerid,"PriceCTO");
					MysqlUpdateBizzInt(i, "money", BizzInfo[i][bMoney]);
					MysqlUpdateBizzInt(i, "product", BizzInfo[i][bProduct]);
				}
				ShowSTODialog(playerid);
				SaveVehicleTuning(playerid);
				SCM(playerid,COLOR_GREEN,"Âû êóïèëè ýòó çàï÷àñòü");
			}
			else
			{
				if(GetPlayerVehicleID(playerid) == PI[playerid][PlayerCarID][0] || GetPlayerVehicleID(playerid) == PI[playerid][PlayerCarID][1])
				{
					new slot;
		            if(GetPlayerVehicleID(playerid) == PI[playerid][PlayerCarID][0]) slot = 0;
		            if(GetPlayerVehicleID(playerid) == PI[playerid][PlayerCarID][1]) slot = 1;
					ShowSTODialog(playerid);
					SCM(playerid, COLOR_RED, "Âû îòìåíèëè ïîêóïêó");
					RemoveVehicleComponent(GetPlayerVehicleID(playerid), GetPVarInt(playerid,"ComponentCTO"));
					if(slot == 0) { for(new s; s < 14; s++) if(cVehcoms1[playerid][s] != 0) AddVehicleComponent(GetPlayerVehicleID(playerid), cVehcoms1[playerid][s]); }
					else { for(new s; s < 14; s++) if(cVehcoms2[playerid][s] != 0) AddVehicleComponent(GetPlayerVehicleID(playerid), cVehcoms2[playerid][s]); }
				}
			}
		}

Edited by stibs
Причина: spoiler

Share this post


Link to post
  • 0

@stibs 

CREATE TABLE IF NOT EXISTS `vehicle` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `model` int(11) NOT NULL DEFAULT '0',
  `x` varchar(10) NOT NULL DEFAULT '0',
  `y` varchar(10) NOT NULL DEFAULT '0',
  `z` varchar(10) NOT NULL DEFAULT '0',
  `fa` varchar(10) NOT NULL DEFAULT '0',
  `vint` int(11) NOT NULL DEFAULT '0',
  `world` int(11) NOT NULL,
  `colors` varchar(10) NOT NULL DEFAULT '0, 0',
  `fraction` int(11) NOT NULL DEFAULT '0',
  `status` int(11) NOT NULL DEFAULT '0',
  `cost` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=136 ;

 

Share this post


Link to post
  • 0

@stibs 

Цитата

 Да, потом писать загрузку и выдачу тюнинга. 


Кто нибудь из вас пишет такие скрипты и т.д? (Возможно и за деньги соглашусь)

Share this post


Link to post
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • Ruman
      By Ruman
      Здравствуйте! У меня тут одна проблема возникла, когда я написал RP команды такие как /me /ame /do /try /todo /n /s решил их протестировать но они не работали как будто я их и не добавлял. Пожалуйста, попытайтесь найти ошибочку.
       
      Код:
      С нетерпением жду ответа!