chevacheva
Новичок
Приветствую, форумчане. Баг с ценами после покупки в магазине. Открываю меню магазина(цены нормальные), покупаю что-нибудь и меня возвращает в это же окно, но уже с добавленными тремя нолями к ценам, но эта цена визуальна и при покупки истрачивается настоящая цена. Ума не приложу что это может быть.
PHP:
case 5589:
{
for(new h = 0; h < sizeof(Business); h++)
{
new cena = Business[h][bCena];
new cena2 = Business[h][bCena] * 2;
new cena3 = Business[h][bCena] * 3;
new cena4 = Business[h][bCena] * 4;
new cena5 = Business[h][bCena] * 5;
new cena6 = Business[h][bCena] * 6;
new cena7 = Business[h][bCena] * 7;
new cena8 = Business[h][bCena] * 8;
if(response)
{
if(listitem == 0)
{
new Float:health;
GetPlayerHealth(playerid,health);
if(PlayerToPoint(3, playerid,Business[h][bBarX], Business[h][bBarY], Business[h][bBarZ]))
{
if(Business[h][bProducts] <= 0) return SendClientMessage(playerid, COLOR_GREY,"Нет продуктов");
if(PlayerInfo[playerid][pCash] < cena) return SendClientMessage(playerid, COLOR_GREY, "У вас нет столько денег на руках!");
Business[h][b2Till] +=cena;
Business[h][bProducts]-=10;
PlayerInfo[playerid][pCash] -=cena;
new randphone = 10000 + random(899999);
PlayerInfo[playerid][pPnumber] = randphone;
SendMes(playerid,COLOR_BLUE,"Вы купили новый номер телефона. Ваш новый номер: %d", randphone);
cmd::buymagazins(playerid, "");
}
}
else if(listitem == 1)
{
new Float:health;
GetPlayerHealth(playerid,health);
if(PlayerToPoint(3, playerid,Business[h][bBarX], Business[h][bBarY], Business[h][bBarZ]))
{
if(Business[h][bProducts] <= 0) return SendClientMessage(playerid, COLOR_GREY,"Нет продуктов");
if(PlayerInfo[playerid][pCash] < cena2) return SendClientMessage(playerid, COLOR_GREY, "У вас нет столько денег на руках!");
Business[h][b2Till] += cena2;
Business[h][bProducts]-=10;
PlayerInfo[playerid][pCash] -=cena2;
SendClientMessage(playerid, 0x6ab1ffaa,"Вы купили телефонную книгу. Теперь вы можете узнать номер любого человека!");
SendClientMessage(playerid, COLOR_WHITE, "Введите: /number <id/name>.");
cmd::buymagazins(playerid, "");
}
}
else if(listitem == 2)
{
new Float:health;
GetPlayerHealth(playerid,health);
if(PlayerToPoint(3, playerid,Business[h][bBarX], Business[h][bBarY], Business[h][bBarZ]))
{
if(Business[h][bProducts] <= 0) return SendClientMessage(playerid, COLOR_GREY,"Нет продуктов");
if(PlayerInfo[playerid][pCash] < cena3) return SendClientMessage(playerid, COLOR_GREY, "У вас нет столько денег на руках!");
Business[h][b2Till] += cena3;
Business[h][bProducts]-=10;
PlayerInfo[playerid][pCash] -=cena3;
SendMes(playerid,COLOR_BLUE,"Вы купили Справочник /directory!");
cmd::buymagazins(playerid, "");
}
}
else if(listitem == 3)
{
new Float:health;
GetPlayerHealth(playerid,health);
if(PlayerToPoint(3, playerid,Business[h][bBarX], Business[h][bBarY], Business[h][bBarZ]))
{
if(Business[h][bProducts] <= 0) return SendClientMessage(playerid, COLOR_GREY,"Нет продуктов");
if(PlayerInfo[playerid][pCash] < cena4) return SendClientMessage(playerid, COLOR_GREY, "У вас нет столько денег на руках!");
if(PlayerInfo[playerid][pPhousekey] == 255) return SendClientMessage(playerid, COLOR_WHITE, "У вас нет дома");
new house = PlayerInfo[playerid][pPhousekey];
HomeInfo[house][hHel] +=5;
Business[h][b2Till] += cena4;
Business[h][bProducts]-=20;
PlayerInfo[playerid][pCash] -=cena4;
SendMes(playerid,COLOR_BLUE,"Вы купили в квартиру 5 аптечек");
cmd::buymagazins(playerid, "");
}
}
else if(listitem == 4)
{
new Float:health;
GetPlayerHealth(playerid,health);
if(PlayerToPoint(3, playerid,Business[h][bBarX], Business[h][bBarY], Business[h][bBarZ]))
{
if(Business[h][bProducts] <= 0) return SendClientMessage(playerid, COLOR_GREY,"Нет продуктов");
if(PlayerInfo[playerid][pCash] < cena5) return SendClientMessage(playerid, COLOR_GREY, "У вас нет столько денег на руках!");
Business[h][b2Till] += cena5;
Business[h][bProducts]-=10;
PlayerInfo[playerid][pCash] -=cena5;
GivePlayerWeapon(playerid, 43, 10);
SendClientMessage(playerid, COLOR_BLUE, "Вы купили фотоаппарат");
cmd::buymagazins(playerid, "");
}
}
else if(listitem == 5)
{
new Float:health;
GetPlayerHealth(playerid,health);
if(PlayerToPoint(3, playerid,Business[h][bBarX], Business[h][bBarY], Business[h][bBarZ]))
{
if(Business[h][bProducts] <= 0) return SendClientMessage(playerid, COLOR_GREY,"Нет продуктов");
if(PlayerInfo[playerid][pCash] < cena6) return SendClientMessage(playerid, COLOR_GREY, "У вас нет столько денег на руках!");
Business[h][b2Till] += cena6;
Business[h][bProducts]-=5;
PlayerInfo[playerid][pCash] -=cena6;
GivePlayerWeapon(playerid, 14, 1);
SendClientMessage(playerid, COLOR_BLUE, "Вы купили цветы");
cmd::buymagazins(playerid, "");
}
}
else if(listitem == 6)
{
if(PlayerToPoint(3, playerid,Business[h][bBarX], Business[h][bBarY], Business[h][bBarZ]))
{
if(Business[h][bProducts] <= 0)return SendClientMessage(playerid, COLOR_GREY,"Нет продуктов");
if(PlayerInfo[playerid][pCash] < cena) return SendClientMessage(playerid, COLOR_GREY, "У вас нет столько денег на руках!");
Business[h][b2Till] += cena7;
Business[h][bProducts]-= 10;
PlayerInfo[playerid][pCash] -= cena7;
PlayerInfo[playerid][pPrez] ++;
SendClientMessage(playerid, COLOR_BLUE, "Вы купили презерватив.");
cmd::buymagazins(playerid, "");
}
}
else if(listitem == 7)
{
new Float:health;
GetPlayerHealth(playerid,health);
if(PlayerToPoint(3, playerid,Business[h][bBarX], Business[h][bBarY], Business[h][bBarZ]))
{
if(Business[h][bProducts] <= 0) return SendClientMessage(playerid, COLOR_GREY,"Нет продуктов");
if(PlayerInfo[playerid][pCash] < cena8) return SendClientMessage(playerid, COLOR_GREY, "У вас нет столько денег на руках!");
Business[h][b2Till] += cena8;
Business[h][bProducts]-=10;
PlayerInfo[playerid][pCash] -=cena7;
SendClientMessage(playerid, COLOR_BLUE, "Вы купили перцовый балончик");
cmd::buymagazins(playerid, "");
}
}
else if(listitem == 8)
{
if(PlayerToPoint(3, playerid,Business[h][bBarX], Business[h][bBarY], Business[h][bBarZ]))
{
if(Business[h][bProducts] <= 9) return SendClientMessage(playerid, COLOR_GREY,"Нет продуктов");
if(PlayerInfo[playerid][pOtmbI4ka] > 9) return SendClientMessage(playerid, COLOR_GREY,"У Вас максимальное кол-во отмычек.");
if(PlayerInfo[playerid][pCash] < cena2) return SendClientMessage(playerid, COLOR_GREY, "У вас нет столько денег на руках!");
Business[h][b2Till] += cena2;
Business[h][bProducts]-=10;
PlayerInfo[playerid][pCash] -=cena2;
PlayerInfo[playerid][pOtmbI4ka] += 3;
SendClientMessage(playerid, COLOR_BLUE, "Вы купили набор отмычек");
cmd::buymagazins(playerid, "");
}
}
else if(listitem == 9)
{
if(PlayerToPoint(3, playerid,Business[h][bBarX], Business[h][bBarY], Business[h][bBarZ]))
{
if(Business[h][bProducts] <= 3)return SendClientMessage(playerid, COLOR_GREY,"Нет продуктов");
if(PlayerInfo[playerid][pVerevka] > 9)return SendClientMessage(playerid, COLOR_GREY,"У Вас максимальное кол-во веревок.");
if(PlayerInfo[playerid][pCash] < cena) return SendClientMessage(playerid, COLOR_GREY, "У вас нет столько денег на руках!");
Business[h][b2Till] += cena;
Business[h][bProducts]-= 3;
PlayerInfo[playerid][pCash] -= cena;
PlayerInfo[playerid][pVerevka] ++;
SendClientMessage(playerid, COLOR_BLUE, "Вы купили веревку");
cmd::buymagazins(playerid, "");
}
}
}
else return true;
}
}
PHP:
CMD:buymagazins(playerid, params[])
{
new bizinfo[305];
for(new i = 0; i < sizeof(Business); i++)
{
new cena = Business[i][bCena];
new cena2 = Business[i][bCena] * 2;
new cena3 = Business[i][bCena] * 3;
new cena4 = Business[i][bCena] * 4;
new cena5 = Business[i][bCena] * 5;
new cena6 = Business[i][bCena] * 6;
new cena7 = Business[i][bCena] * 7;
new cena8 = Business[i][bCena] * 8;
format(bizinfo,sizeof(bizinfo),"- Телефоный номер [%d рублей]\n- Телефонная книга[%d рублей]\n- Справочник [%d рублей]\n- Аптечки [%d рублей]\n- Фотоаппарат [%d рублей]\n- Цветы [%d рублей]\n- Презерватив [%d рублей]\n- Перцовый балончик [%d рублей]\n- Набор отмычек [%d рублей]\n- Веревка [%d рублей]",cena,cena2,cena3,cena4,cena5,cena6,cena7,cena8,cena2,cena);
ShowPlayerDialog(playerid, 5589, DIALOG_STYLE_LIST, "24/7", bizinfo, "Купить", "Скрыть");
}
return true;
}
Последнее редактирование:
