Рекомендованные сообщения



8 posts in this topic

Добрый день, игроки/я покупают машину и она появляется только после рестарта.

Мод : Amazing RP

Share this post


Link to post
Share on other sites

Давайте я вам скину мод, не очень разбираюсь, секунду 

 

Вот ссылка на gamemode: https://yadi.sk/d/lNVpQy5e3N7eMK

Share this post


Link to post
Share on other sites

@Timur_Top stock BuyCar замените на этот: 

Спойлер

stock BuyCar(playerid)
{
	if(GetPlayerHouse(playerid) == 1 || GetPlayerPorchHouse(playerid))
	{
		new Float:x, Float:y, Float:z, Float:fa,cost[MAX_PLAYERS],model[MAX_PLAYERS];
		switch(InShop[playerid])
		{
			case 1: cost[playerid] = carsC[pPressed[playerid]][1], model[playerid] = carsC[pPressed[playerid]][0], x=2010.7631, y=1887.6563, z=15.5638, fa=5.0665;
			case 2: cost[playerid] = carsB[pPressed[playerid]][1], model[playerid] = carsB[pPressed[playerid]][0], x=2010.7631, y=1887.6563, z=15.5638, fa=5.0665;
			case 3: cost[playerid] = carsA[pPressed[playerid]][1], model[playerid] = carsA[pPressed[playerid]][0], x=2010.7631, y=1887.6563, z=15.5638, fa=5.0665;
			case 4: cost[playerid] = carsBike[pPressed[playerid]][1], model[playerid] = carsBike[pPressed[playerid]][0], x=2010.7631, y=1887.6563, z=15.5638, fa=5.0665;
		}
		switch(InShop[playerid])
		{
			case 1: PI[playerid][cClass] = 1;
			case 2: PI[playerid][cClass] = 2;
			case 3: PI[playerid][cClass] = 3;
			case 4: PI[playerid][cClass] = 4;
		}
		if(PI[playerid][pCash] < cost[playerid]) return SendClientMessage(playerid, COLOR_GREY, "На вашем счету в банке не хватает денег!");
		InShop[playerid] = 0;
		TogglePlayerControllable(playerid,true);
		PI[playerid][pCash] -= cost[playerid];
		for(new i; i < 16; i++) PlayerTextDrawHide(playerid,AvtosalonTD[playerid][i]);
		SetPlayerPos(playerid,x,y,z);
		SetPlayerFacingAngle(playerid,fa);
		SetPlayerInterior(playerid,0);
		SetPlayerVirtualWorld(playerid,0);
		SetCameraBehindPlayer(playerid);

		for(new i = 0; i < 14; i++) PI[playerid][cVehcoms][i] = 0;
		format(PI[playerid][cVehcom], 64, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",
		PI[playerid][cVehcoms][0],PI[playerid][cVehcoms][1],PI[playerid][cVehcoms][2],
		PI[playerid][cVehcoms][3],PI[playerid][cVehcoms][4],PI[playerid][cVehcoms][5],
		PI[playerid][cVehcoms][6],PI[playerid][cVehcoms][7],PI[playerid][cVehcoms][8],
		PI[playerid][cVehcoms][9],PI[playerid][cVehcoms][10],PI[playerid][cVehcoms][11],
		PI[playerid][cVehcoms][12],PI[playerid][cVehcoms][13]);

		PI[playerid][cModel] = model[playerid];
		PI[playerid][cCost] = cost[playerid];
		PI[playerid][cLock] = 1;
		PI[playerid][cFuel] = 45;
		PI[playerid][cColor][0] = colors[playerid][0];
		PI[playerid][cColor][1] = colors[playerid][1];
		PI[playerid][cPaintjob] = 3;
		
		SendClientMessage(playerid, COLOR_BLUE, "Поздравляем Вас с успешной покупкой авто.");
		SendClientMessage(playerid, COLOR_BLUE, "Получить номера вы можете в полиции({ffcc00}/mynumber{0099FF}).");
		CancelSelectTextDraw(playerid);
		
		if(PI[playerid][SalonCarID] != INVALID_VEHICLE_ID) DestroyVehicle(PI[playerid][SalonCarID]);
		PI[playerid][SalonCarID] = INVALID_VEHICLE_ID;
		
		if(PI[playerid][PlayerCarID] != INVALID_VEHICLE_ID)
		{
			DestroyVehicle(PI[playerid][PlayerCarID]);
			PI[playerid][PlayerCarID] = CreateVehicle(model[playerid], x, y, z, fa, colors[playerid][0], colors[playerid][1], -100);
		}
		pPressed[playerid] = 0;
		new string[128];
		format(string, sizeof(string), "Игрок %s купил транспорт %s[%i] за %d Рублей", GetName(playerid), VehicleNames[GetVehicleModel(PI[playerid][PlayerCarID])-400], GetPlayerVehicleID(playerid), cost[playerid]);
		SendLog("BuyCar", string);
		if(GetPlayerPorchHouse(playerid) == 0) LoadMyCar(playerid);
	}
	return 1;
}

 

 

Share this post


Link to post
Share on other sites

@stibs щас протестю.

Заметка от Guest , создано

Сначала тестите, а потом пишите результат. Не разводите флуд.

Share this post


Link to post
Share on other sites

@stibs неа, не работает, все равно, только после перезагрузки сервера авто появилось..

Share this post


Link to post
Share on other sites
Спойлер

stock BuyCar(playerid)
{
	if(GetPlayerHouse(playerid) == 1 || GetPlayerPorchHouse(playerid))
	{
		new Float:x, Float:y, Float:z, Float:fa,cost[MAX_PLAYERS],model[MAX_PLAYERS];
		switch(InShop[playerid])
		{
			case 1: cost[playerid] = carsC[pPressed[playerid]][1], model[playerid] = carsC[pPressed[playerid]][0], x=2010.7631, y=1887.6563, z=15.5638, fa=5.0665;
			case 2: cost[playerid] = carsB[pPressed[playerid]][1], model[playerid] = carsB[pPressed[playerid]][0], x=2010.7631, y=1887.6563, z=15.5638, fa=5.0665;
			case 3: cost[playerid] = carsA[pPressed[playerid]][1], model[playerid] = carsA[pPressed[playerid]][0], x=2010.7631, y=1887.6563, z=15.5638, fa=5.0665;
			case 4: cost[playerid] = carsBike[pPressed[playerid]][1], model[playerid] = carsBike[pPressed[playerid]][0], x=2010.7631, y=1887.6563, z=15.5638, fa=5.0665;
		}
		switch(InShop[playerid])
		{
			case 1: PI[playerid][cClass] = 1;
			case 2: PI[playerid][cClass] = 2;
			case 3: PI[playerid][cClass] = 3;
			case 4: PI[playerid][cClass] = 4;
		}
		if(PI[playerid][pCash] < cost[playerid]) return SendClientMessage(playerid, COLOR_GREY, "На вашем счету в банке не хватает денег!");
		InShop[playerid] = 0;
		TogglePlayerControllable(playerid,true);
		PI[playerid][pCash] -= cost[playerid];
		for(new i; i < 16; i++) PlayerTextDrawHide(playerid,AvtosalonTD[playerid][i]);
		SetPlayerPos(playerid,x,y,z);
		SetPlayerFacingAngle(playerid,fa);
		SetPlayerInterior(playerid,0);
		SetPlayerVirtualWorld(playerid,0);
		SetCameraBehindPlayer(playerid);

		for(new i = 0; i < 14; i++) PI[playerid][cVehcoms][i] = 0;
		format(PI[playerid][cVehcom], 64, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",
		PI[playerid][cVehcoms][0],PI[playerid][cVehcoms][1],PI[playerid][cVehcoms][2],
		PI[playerid][cVehcoms][3],PI[playerid][cVehcoms][4],PI[playerid][cVehcoms][5],
		PI[playerid][cVehcoms][6],PI[playerid][cVehcoms][7],PI[playerid][cVehcoms][8],
		PI[playerid][cVehcoms][9],PI[playerid][cVehcoms][10],PI[playerid][cVehcoms][11],
		PI[playerid][cVehcoms][12],PI[playerid][cVehcoms][13]);

		PI[playerid][cModel] = model[playerid];
		PI[playerid][cCost] = cost[playerid];
		PI[playerid][cLock] = 1;
		PI[playerid][cFuel] = 45;
		PI[playerid][cColor][0] = colors[playerid][0];
		PI[playerid][cColor][1] = colors[playerid][1];
		PI[playerid][cPaintjob] = 3;
		
		SendClientMessage(playerid, COLOR_BLUE, "Поздравляем Вас с успешной покупкой авто.");
		SendClientMessage(playerid, COLOR_BLUE, "Получить номера вы можете в полиции({ffcc00}/mynumber{0099FF}).");
		CancelSelectTextDraw(playerid);
		
		if(PI[playerid][SalonCarID] != INVALID_VEHICLE_ID) DestroyVehicle(PI[playerid][SalonCarID]);
		PI[playerid][SalonCarID] = INVALID_VEHICLE_ID;
		
		if(PI[playerid][PlayerCarID] != INVALID_VEHICLE_ID)
		{
			DestroyVehicle(PI[playerid][PlayerCarID]);
		}
        PI[playerid][PlayerCarID] = CreateVehicle(model[playerid], x, y, z, fa, colors[playerid][0], colors[playerid][1], -100);
        printf("%d - carid", PI[playerid][PlayerCarID]);
		pPressed[playerid] = 0;
		new string[128];
		format(string, sizeof(string), "Игрок %s купил транспорт %s[%i] за %d Рублей", GetName(playerid), VehicleNames[GetVehicleModel(PI[playerid][PlayerCarID])-400], GetPlayerVehicleID(playerid), cost[playerid]);
		SendLog("BuyCar", string);
		if(GetPlayerPorchHouse(playerid) == 0) LoadMyCar(playerid);
	}
	return 1;
}

 

Вот так пробуйте. Если не получится выкладывайте логи. 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • php34
      By php34
      Ищу скрипт который меняет IP при подключении к серверу той же Родины на мой, тем самым я захожу на свой сервер через сборку Родины.
      Такой скрипт я видел на разных копиях Радмир РП но не могу найти на Родину.
      При редактировании скрипта вылезают всякие символы.
      Может у кого есть нормальный скрипт?