- Автор темы
- #1
Помогите сделать команду buybiz
Когда становлюсь на пикап у меня открывается диалог и там можно выбрать "купить" "отмена" мне нужно что бы было "войти" "отмена"
Пытался сделать по примеру команды покупки азс не получилось
Вот диалоги
Когда становлюсь на пикап у меня открывается диалог и там можно выбрать "купить" "отмена" мне нужно что бы было "войти" "отмена"
Пытался сделать по примеру команды покупки азс не получилось
CMD:buyfueling(playerid)
{
if (PI[playerid][pBusiness]) return ErrorMessage(playerid, "У Вас уже есть бизнес");
new i = GetNearestTrunckFuel(playerid);
if (i == -1) return ErrorMessage(playerid, "Вы должны быть на АЗС");
SetPVarInt(playerid, "bfillingid", i);
new string[128];
if (!gBusiness[bizzOwnerID])
{
new price_bizz = gBusiness[bizzSellPrice];
if (TYPE_VIP[playerid] != VIP_STATE_NONE)
{
price_bizz = GetReasonMoneyPercentVip(playerid, TYPE_VIP_BUSINESS, gBusiness[bizzSellPrice]);
}
format(string, sizeof(string), ""W"Данная АЗС продается за "ORANGE"$%d", price_bizz);
ShowPlayerDialog(playerid, D_BIZZ_BUY_FILL, DSM, ""P"Бизнес", string, "Купить", "Отмена");
}
else ErrorMessage(playerid, "Данная Автозаправочная станция уже приобретена кем-то");
return 1;
}
{
if (PI[playerid][pBusiness]) return ErrorMessage(playerid, "У Вас уже есть бизнес");
new i = GetNearestTrunckFuel(playerid);
if (i == -1) return ErrorMessage(playerid, "Вы должны быть на АЗС");
SetPVarInt(playerid, "bfillingid", i);
new string[128];
if (!gBusiness[bizzOwnerID])
{
new price_bizz = gBusiness[bizzSellPrice];
if (TYPE_VIP[playerid] != VIP_STATE_NONE)
{
price_bizz = GetReasonMoneyPercentVip(playerid, TYPE_VIP_BUSINESS, gBusiness[bizzSellPrice]);
}
format(string, sizeof(string), ""W"Данная АЗС продается за "ORANGE"$%d", price_bizz);
ShowPlayerDialog(playerid, D_BIZZ_BUY_FILL, DSM, ""P"Бизнес", string, "Купить", "Отмена");
}
else ErrorMessage(playerid, "Данная Автозаправочная станция уже приобретена кем-то");
return 1;
}
Вот диалоги
new mes2[128];
if (businessid < 0) return SendClientMessage(playerid, COLOR_GREY, "Ошибка (#100)");
if (!gBusiness[businessid][bizzStatus]) return true;
TI[playerid][tSelectedBusinessID] = businessid;
if ((!gBusiness[businessid][bizzOwnerID] && gBusiness[businessid][bizzType] != 7) && (!gBusiness[businessid][bizzOwnerID] && gBusiness[businessid][bizzType] != 11) && (!gBusiness[businessid][bizzOwnerID] && gBusiness[businessid][bizzType] != 14) && (!gBusiness[businessid][bizzOwnerID] && gBusiness[businessid][bizzType] != 15))
{
new price_bizz = gBusiness[businessid][bizzSellPrice];
if (TYPE_VIP[playerid] != VIP_STATE_NONE)
{
price_bizz = GetReasonMoneyPercentVip(playerid, TYPE_VIP_BUSINESS, gBusiness[businessid][bizzSellPrice]);
}
format(mes2, sizeof(mes2), ""W"Данный бизнес продается за "GREEN"$%d", price_bizz);
return ShowPlayerDialog(playerid, D_BIZZ_BUY, DSM, ""P"Бизнес", mes2, "Купить", "Войти");
}
else
{
if (gBusiness[businessid][bizzType] == 8)
{
if (IsPlayerInRangeOfPoint(playerid, 5.0, 545.7042, -1293.4833, 17.2422)) PlayerClassFix[playerid] = 1;
if (IsPlayerInRangeOfPoint(playerid, 5.0, -1965.6605, 293.9383, 35.4688)) PlayerClassFix[playerid] = 3;
if (IsPlayerInRangeOfPoint(playerid, 5.0, 2200.8638, 1394.8074, 11.0625)) PlayerClassFix[playerid] = 5;
if (IsPlayerInRangeOfPoint(playerid, 5.0, 2131.8152, -1151.3242, 24.0600)) PlayerClassFix[playerid] = 6;
return ShowPlayerDialog(playerid, dBuyCarSalon, DSM, ""P"Автосалон", "\n\n"W"Вы хотите посмотреть список машин?\n\n", "Да", "Нет");
}
else
{
if (gBusiness[businessid][bizzEnter] && gBusiness[businessid][bizzOwnerID] != PI[playerid][pID])
{
new string[128];
format(string, sizeof(string), ""W"Стоимость входа "GREEN"$%d", gBusiness[businessid][bizzEnter]);
ShowPlayerDialog(playerid, D_BIZZ_ENTERS, DSM, ""P"Бизнес", string, "Войти", "Отмена");
return 1;
}
new bint = gBusiness[businessid][bizzBint] - 1;
if (bint < 0 || bint >= BINT_COUNT) return 1;
TI[playerid][tTPpick] = true;
SetPlayerPosAC(playerid, gBints[bint][bintX], gBints[bint][bintY], gBints[bint][bintZ], businessid + 1, gBints[bint][bintInterior]);
SetPlayerFacingAngle(playerid, gBints[bint][bintR]);
gBusiness[businessid][bizzVisitors]++;
SetCameraBehindPlayer(playerid);
if (gBusiness[businessid][bizzType] == 10 || gBusiness[businessid][bizzType] == 11 || gBusiness[businessid][bizzType] == 14 || gBusiness[businessid][bizzType] == 15) OnPlayerUpdateLoadingMode(playerid);
}
}
}
if (businessid < 0) return SendClientMessage(playerid, COLOR_GREY, "Ошибка (#100)");
if (!gBusiness[businessid][bizzStatus]) return true;
TI[playerid][tSelectedBusinessID] = businessid;
if ((!gBusiness[businessid][bizzOwnerID] && gBusiness[businessid][bizzType] != 7) && (!gBusiness[businessid][bizzOwnerID] && gBusiness[businessid][bizzType] != 11) && (!gBusiness[businessid][bizzOwnerID] && gBusiness[businessid][bizzType] != 14) && (!gBusiness[businessid][bizzOwnerID] && gBusiness[businessid][bizzType] != 15))
{
new price_bizz = gBusiness[businessid][bizzSellPrice];
if (TYPE_VIP[playerid] != VIP_STATE_NONE)
{
price_bizz = GetReasonMoneyPercentVip(playerid, TYPE_VIP_BUSINESS, gBusiness[businessid][bizzSellPrice]);
}
format(mes2, sizeof(mes2), ""W"Данный бизнес продается за "GREEN"$%d", price_bizz);
return ShowPlayerDialog(playerid, D_BIZZ_BUY, DSM, ""P"Бизнес", mes2, "Купить", "Войти");
}
else
{
if (gBusiness[businessid][bizzType] == 8)
{
if (IsPlayerInRangeOfPoint(playerid, 5.0, 545.7042, -1293.4833, 17.2422)) PlayerClassFix[playerid] = 1;
if (IsPlayerInRangeOfPoint(playerid, 5.0, -1965.6605, 293.9383, 35.4688)) PlayerClassFix[playerid] = 3;
if (IsPlayerInRangeOfPoint(playerid, 5.0, 2200.8638, 1394.8074, 11.0625)) PlayerClassFix[playerid] = 5;
if (IsPlayerInRangeOfPoint(playerid, 5.0, 2131.8152, -1151.3242, 24.0600)) PlayerClassFix[playerid] = 6;
return ShowPlayerDialog(playerid, dBuyCarSalon, DSM, ""P"Автосалон", "\n\n"W"Вы хотите посмотреть список машин?\n\n", "Да", "Нет");
}
else
{
if (gBusiness[businessid][bizzEnter] && gBusiness[businessid][bizzOwnerID] != PI[playerid][pID])
{
new string[128];
format(string, sizeof(string), ""W"Стоимость входа "GREEN"$%d", gBusiness[businessid][bizzEnter]);
ShowPlayerDialog(playerid, D_BIZZ_ENTERS, DSM, ""P"Бизнес", string, "Войти", "Отмена");
return 1;
}
new bint = gBusiness[businessid][bizzBint] - 1;
if (bint < 0 || bint >= BINT_COUNT) return 1;
TI[playerid][tTPpick] = true;
SetPlayerPosAC(playerid, gBints[bint][bintX], gBints[bint][bintY], gBints[bint][bintZ], businessid + 1, gBints[bint][bintInterior]);
SetPlayerFacingAngle(playerid, gBints[bint][bintR]);
gBusiness[businessid][bizzVisitors]++;
SetCameraBehindPlayer(playerid);
if (gBusiness[businessid][bizzType] == 10 || gBusiness[businessid][bizzType] == 11 || gBusiness[businessid][bizzType] == 14 || gBusiness[businessid][bizzType] == 15) OnPlayerUpdateLoadingMode(playerid);
}
}
}
case D_BIZZ_BUY: {
new businessid = TI[playerid][tSelectedBusinessID];
if (businessid < 0) return true;
if (!response)
{
if (gBusiness[businessid][bizzType] == 8)
{
if (IsPlayerInRangeOfPoint(playerid, 10.0, 545.7042, -1293.4833, 17.2422)) PlayerClassFix[playerid] = 1;
if (IsPlayerInRangeOfPoint(playerid, 10.0, -1965.6605, 293.9383, 35.4688)) PlayerClassFix[playerid] = 3;
if (IsPlayerInRangeOfPoint(playerid, 10.0, 2200.8638, 1394.8074, 11.0625)) PlayerClassFix[playerid] = 5;
if (IsPlayerInRangeOfPoint(playerid, 10.0, 2131.8152, -1151.3242, 24.0600)) PlayerClassFix[playerid] = 6;
//new carclass = PlayerClassFix[playerid];
TI[playerid][tTPpick] = true;
SetPlayerPosAC(playerid, 1449.4907, 702.5972, 1087.9011, businessid + 1/*carclass*/, 82);
SetPlayerFacingAngle(playerid, 88.9930);
OnPlayerUpdateLoadingMode(playerid);
SetCameraBehindPlayer(playerid);
gBusiness[businessid][bizzVisitors]++;
return 1;
}
new bint = gBusiness[businessid][bizzBint] - 1;
if (bint < 0 || bint >= BINT_COUNT) return 1;
TI[playerid][tTPpick] = true;
SetPlayerInterior(playerid, gBints[bint][bintInterior]);
SetPlayerVirtualWorld(playerid, businessid + 1);
SetPlayerPosAC(playerid, gBints[bint][bintX], gBints[bint][bintY], gBints[bint][bintZ], businessid + 1, gBints[bint][bintInterior]);
SetPlayerFacingAngle(playerid, gBints[bint][bintR]);
OnPlayerUpdateLoadingMode(playerid);
gBusiness[businessid][bizzVisitors]++;
SetCameraBehindPlayer(playerid);
} else {
if (businessid < 0) return true;
if (gBusiness[businessid][bizzOwnerID]) return ErrorMessage(playerid, "Этот бизнес уже кто-то купил");
new mes[128], price_bizz = gBusiness[businessid][bizzSellPrice];
if (TYPE_VIP[playerid] != VIP_STATE_NONE) {
price_bizz = GetReasonMoneyPercentVip(playerid, TYPE_VIP_BUSINESS, gBusiness[businessid][bizzSellPrice]);
}
format(mes, sizeof(mes), ""W"Вы действительно хотите купить этот бизнес за "GREEN"$%d"W"?", price_bizz);
ShowPlayerDialog(playerid, D_BIZZ_UPDATE, DSM, ""P"Бизнес", mes, "Да", "Нет");
return 1;
}
}
new businessid = TI[playerid][tSelectedBusinessID];
if (businessid < 0) return true;
if (!response)
{
if (gBusiness[businessid][bizzType] == 8)
{
if (IsPlayerInRangeOfPoint(playerid, 10.0, 545.7042, -1293.4833, 17.2422)) PlayerClassFix[playerid] = 1;
if (IsPlayerInRangeOfPoint(playerid, 10.0, -1965.6605, 293.9383, 35.4688)) PlayerClassFix[playerid] = 3;
if (IsPlayerInRangeOfPoint(playerid, 10.0, 2200.8638, 1394.8074, 11.0625)) PlayerClassFix[playerid] = 5;
if (IsPlayerInRangeOfPoint(playerid, 10.0, 2131.8152, -1151.3242, 24.0600)) PlayerClassFix[playerid] = 6;
//new carclass = PlayerClassFix[playerid];
TI[playerid][tTPpick] = true;
SetPlayerPosAC(playerid, 1449.4907, 702.5972, 1087.9011, businessid + 1/*carclass*/, 82);
SetPlayerFacingAngle(playerid, 88.9930);
OnPlayerUpdateLoadingMode(playerid);
SetCameraBehindPlayer(playerid);
gBusiness[businessid][bizzVisitors]++;
return 1;
}
new bint = gBusiness[businessid][bizzBint] - 1;
if (bint < 0 || bint >= BINT_COUNT) return 1;
TI[playerid][tTPpick] = true;
SetPlayerInterior(playerid, gBints[bint][bintInterior]);
SetPlayerVirtualWorld(playerid, businessid + 1);
SetPlayerPosAC(playerid, gBints[bint][bintX], gBints[bint][bintY], gBints[bint][bintZ], businessid + 1, gBints[bint][bintInterior]);
SetPlayerFacingAngle(playerid, gBints[bint][bintR]);
OnPlayerUpdateLoadingMode(playerid);
gBusiness[businessid][bizzVisitors]++;
SetCameraBehindPlayer(playerid);
} else {
if (businessid < 0) return true;
if (gBusiness[businessid][bizzOwnerID]) return ErrorMessage(playerid, "Этот бизнес уже кто-то купил");
new mes[128], price_bizz = gBusiness[businessid][bizzSellPrice];
if (TYPE_VIP[playerid] != VIP_STATE_NONE) {
price_bizz = GetReasonMoneyPercentVip(playerid, TYPE_VIP_BUSINESS, gBusiness[businessid][bizzSellPrice]);
}
format(mes, sizeof(mes), ""W"Вы действительно хотите купить этот бизнес за "GREEN"$%d"W"?", price_bizz);
ShowPlayerDialog(playerid, D_BIZZ_UPDATE, DSM, ""P"Бизнес", mes, "Да", "Нет");
return 1;
}
}