[V]ip_Ma[N]
Дебютант
Помогите исправить код
Должно быть ,когда садишься в машину вылазить окно что "Вы действительно хотите купить этот автомобиль""Да""Нет"
Нажимаешь "Да" и спокойно едешь ,а получается садишься нажимаешь "Да" тачка появляется где то в ЛВ и не заводиться
Должно быть ,когда садишься в машину вылазить окно что "Вы действительно хотите купить этот автомобиль""Да""Нет"
Нажимаешь "Да" и спокойно едешь ,а получается садишься нажимаешь "Да" тачка появляется где то в ЛВ и не заводиться
PHP:
if(dialogid == 42)
{
if(response)
{
if(IsPlayerConnected(playerid))
{
new buycar;
buycar = GetPlayerVehicleID(playerid);
new vmodel;
new carid;
vmodel = GetVehicleModel(buycar);
if(PlayerInfo[playerid][pCar] == 2)
{
SendClientMessage(playerid, COLOR_WHITE, "У игрока может быть до двух авто");
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
return 1;
}
if(PlayerInfo[playerid][pLevel] < 1)
{
SendClientMessage(playerid, COLOR_WHITE, "Вам нужно прожить в штате не менее 1 лет.");
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
return 1;
}
if(IsPlayerInVehicle(playerid, buycar))
{
new price1;
if(vmodel==576)
{
price1 = 65000;
}
if(vmodel==412)
{
price1 = 35000;
}
if(vmodel==475)
{
price1 = 35000;
}
if(vmodel==439)
{
price1 = 60000;
}
if(vmodel==549)
{
price1 = 30000;
}
if(vmodel==533)
{
price1 = 75000;
}
if(vmodel==526)
{
price1 = 55000;
}
if(vmodel==491)
{
price1 = 55000;
}
if(vmodel==558)
{
price1 = 76000;
}
if(vmodel==422)
{
price1 = 50000;
}
if(vmodel==589)
{
price1 = 45000;
}
if(vmodel==496)
{
price1 = 45000;
}
if(vmodel==458)
{
price1 = 48000;
}
if(vmodel==400)
{
price1 = 52000;
}
if(vmodel==426)
{
price1 = 65000;
}
if(vmodel==405)
{
price1 = 45000;
}
if(vmodel==603)
{
price1 = 220000;
}
if(vmodel==602)
{
price1 = 150000;
}
if(vmodel==587)
{
price1 = 260000;
}
if(vmodel==560)
{
price1 = 150000;
}
if(vmodel==559)
{
price1 = 120000;
}
if(vmodel==541)
{
price1 = 360000;
}
if(vmodel==506)
{
price1 = 320000;
}
if(vmodel==480)
{
price1 = 250000;
}
if(vmodel==477)
{
price1 = 360000;
}
if(vmodel==451)
{
price1 = 360000;
}
if(vmodel==429)
{
price1 = 360000;
}
if(vmodel==415)
{
price1 = 250000;
}
if(vmodel==411)
{
price1 = 360000;
}
if(vmodel==402)
{
price1 = 120000;
}
if(vmodel==409)
{
price1 = 360000;
}
if(vmodel==604)
{
price1 = 10000;
}
if(vmodel==605)
{
price1 = 10000;
}
if(GetPlayerMoney(playerid)>=price1)
{
if(PlayerToPoint(40.0,playerid,-1945.7933,265.0798,41.0471))
{
carid = CreateVehicle(vmodel, -1970.8894,304.8929,34.7381,178.6288, -1, -1, 60000);
}
else
{
carid = CreateVehicle(vmodel, 2163.57,1433.29,10.82,90.3459, -1, -1, 60000);
}
CreatedCars[CreatedCar] = carid;
CreatedCar ++;
OWNABLECARS ++;
CarInfo[OWNABLECARS-1][cId] = vmodel;
CarInfo[OWNABLECARS-1][cColor1] = -1;
CarInfo[OWNABLECARS-1][cColor2] = -1;
CarInfo[OWNABLECARS-1][cCost] = price1;
ServerGivePlayerMoney(playerid,-price1);
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
CarInfo[OWNABLECARS-1][cSTCar_x] = 1412.74;
CarInfo[OWNABLECARS-1][cSTCar_y] = 787.74 -random(100);
CarInfo[OWNABLECARS-1][cSTCar_z] = 10.82;
CarInfo[OWNABLECARS-1][cSTCar_a] = 90.6288;
CarInfo[OWNABLECARS-1][cPARKCar_x] = 1412.74;
CarInfo[OWNABLECARS-1][cPARKCar_y] = 787.74 -random(100);
CarInfo[OWNABLECARS-1][cPARKCar_z] = 10.82;
CarInfo[OWNABLECARS-1][cPARKCar_a] = 90.6288;
CarInfo[OWNABLECARS-1][cPaintJob] = -1;
if(PlayerToPoint(40.0,playerid,-1945.7933,265.0798,41.0471))
{
SetPlayerCheckpoint(playerid, -1970.8894,304.8929,34.7381,5);
}
else
{
SetPlayerCheckpoint(playerid, 2163.57,1433.29,10.82,5);
}
strmid(CarInfo[OWNABLECARS-1][cOwner], name, 0, strlen(name), 999);
SaveStuff();
SaveCars();
SendClientMessage(playerid, COLOR_WHITE, "Поздравляю! Теперь этот транспорт принадлежит вам!");
SendClientMessage(playerid, COLOR_WHITE, "Обязательно припаркуйте ваше авто! ((/park))");
SendClientMessage(playerid, COLOR_WHITE, "Выйдите на улицу и заберите покупку!");
PlayerInfo[playerid][pCar]++;
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
SavePlayer(playerid);
SaveCars();
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "У вас не хватает наличных.");
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
return 1;
}
}
}
}
else
{
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
}
}
