Ко всем new
В OnGameModeInit
Code
DRINK = CreatePickup(1314,22,координата x,координата y,координата z,0);
В OnPlayerPickUpPickup
Code
if(pickupid == DRINK)
{
ShowPlayerDialog(playerid,твой id диалога,DIALOG_STYLE_LIST,"Напитки","Coca-Cola\t(5$)\t(15хп)\nSprite\t(15$)\t(25хп)\nPepsi\t(10$)\t(20хп)","Выбрать","Отмена");
return 1;
}
В OnDialogResponse
Code
if(dialogid == твой id диалога)
{
switch(listitem)
{
case 0:
{
SetPlayerChatBubble(playerid,"Выпил Coca-Cola",0xFF0000FF,10.0,3000);
SendClientMessage(playerid,0xFF0000AA,"Вы выпили Coca-Cola и восстановили 15хп");
SetPlayerHealth(playerid,GetPlayerHealth(playerid)+15);
GivePlayerMoney(playerid,-5);
return 1;
}
case 1:
{
SetPlayerChatBubble(playerid,"Выпил Sprite",0x00ff00FF,10.0,3000);
SendClientMessage(playerid,0xFF0000AA,"Вы выпили Sprite и восстановили 25хп");
SetPlayerHealth(playerid,GetPlayerHealth(playerid)+25);
GivePlayerMoney(playerid,-15);
return 1;
}
case 2:
{
SendClientMessage(playerid,0xFF0000AA,"Вы выпили Pepsi и восстановили 20хп");
SetPlayerChatBubble(playerid,"Выпил Pepsi",0x0000FFFF,10.0,3000);
SetPlayerHealth(playerid,GetPlayerHealth(playerid)+20);
GivePlayerMoney(playerid,-10);
return 1;
}
}
}