>( Делаю диалог всё по инструкции.. сделал диалог вылезает а когда нажимаю к примеру купить пиво ничего не происходит.. диалог убирается и всё..
Code
if(strcmp(cmd, "/drink", true) == 0)
{
if(IsAtBar(playerid))
{
if(GetPlayerDrunkLevel(playerid) < 50000)
{
ShowPlayerDialog(playerid, 200, DIALOG_STYLE_LIST, "×òî èç ýòîãî âû õîòèòå âûïèòü?", "Ïèâî ($4)\nÂîäêà ($6)\nÂèñêè ($6)", "Êóïèòü", "Îòìåíà");
return 1;
}
}
}
Code
{
// Äëÿ áîëåå ïðîñòîãî óïðàâëåíèÿ äèàëîãîâûìè îêíàìè, ìîæíî èñïîëüçîâàòü switch(dialogid), íî â
//ýòîì óðîêå èñïîëüçîâàíî ëèøü îäíî äèàëîãîâîå îêíî.
if(dialogid == 200 && response) // Åñëè ID äèàëîãîâîãî îêíà 1 (êàê ìû óêàçàëè â ShowPlayerDialog), è èãðîê íàæàë 'Êóïèòü'
{
// Òåïåðü èñïîëüçóåì switch(listitem), ÷òîáû âûïîëíÿòü äåéñòâèÿ äëÿ ðàçíûõ ýëåìåíòîâ
//äèàëîãîâîãî îêíà. ID ïåðâîãî ýëåìåíòà â äèàëîãîâîì îêíå - 0.
switch(listitem)
{
case 0:
{
if(GetPlayerMoney(playerid) < 4)
return SendClientMessage(playerid, 0xFFFFFF, "Ó âàñ íåäîñòàòî÷íî äåíåã.");
GivePlayerMoney(playerid, -4);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
SetPlayerHealth(playerid, health + 15.0 + PlayerInfo[playerid][pAlcoholPerk]*5);
}
case 1:
{
if(GetPlayerMoney(playerid) < 6)
return SendClientMessage(playerid, 0xFFFFFF, "Ó âàñ íåäîñòàòî÷íî äåíåã.");
GivePlayerMoney(playerid, -6);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
SetPlayerHealth(playerid, health + 15.0 + PlayerInfo[playerid][pAlcoholPerk]*5);
}
case 2:
{
if(GetPlayerMoney(playerid) < 6)
return SendClientMessage(playerid, 0xFFFFFF, "Ó âàñ íåäîñòàòî÷íî äåíåã.");
GivePlayerMoney(playerid, -6);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
SetPlayerHealth(playerid, health + 15.0 + PlayerInfo[playerid][pAlcoholPerk]*5);
}
}
}
return 1;
}