DialogCreate:BUSINESS_MENU_GET_MONEY(playerid)
{
new string[114 + (3 * 8) - 2 + 11],
biz_id = pInfo[playerid][pBusinessNumber];
format(string
, sizeof string
, "\n\ "C_WHITE"В кассе Вашего бизнеса находится: "C_SUCCESS"$%d\n\
"C_WHITE"Какое количество средств Вы хотите взять из кассы бизнеса?",
bInfo[biz_id][MONEY]
);
Dialog_Open(playerid, Dialog:BUSINESS_MENU_GET_MONEY, DIALOG_STYLE_INPUT,
""C_WHITE"Касса бизнеса",
string,
"Далее", "Назад"
);
return true;
}
DialogResponse:BUSINESS_MENU_GET_MONEY(playerid, response, listitem, inputtext[])
{
if(!response) return Dialog_Show(playerid, Dialog:DLG_BUSINESS_MENU);
new biz_id = pInfo[playerid][pBusiness],
amount;
if(sscanf(inputtext
, "d", amount
)) return Dialog_Show(playerid, Dialog:BUSINESS_MENU_GET_MONEY);
if(bInfo[biz_id][MONEY] < amount) // 324 строка, на нее ругается crashdetect
{
SendErrorMessage(playerid, "В кассе бизнеса недостаточно средств!");
return Dialog_Show(playerid, Dialog:BUSINESS_MENU_GET_MONEY);
}
bInfo[biz_id][MONEY] -= amount;
SaveBusinessEx(biz_id, "MONEY", bInfo[biz_id][MONEY], "d");
GivePlayerMoneyEx(playerid, amount);
new string[42 + (2 * 8) - 2 + 11];
"[ Бизнес ] "C_WHITE"Вы взяли с кассы бизнеса "C_SUCCESS"$%d",
amount
);
Dialog_Show(playerid, Dialog:DLG_BUSINESS_MENU);
return true;
}