23.04.2012, 18:10
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == russianbar)
{
if(response)
{
switch(listitem)
{
case 0:
{
if(GetPlayerMoney(playerid) < 25) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough cash.");
GivePlayerMoney(playerid, -25);
GetPlayerHealth(playerid,hp);
SetPlayerHealth(playerid,hp+15);
}
case 1:
{
if(GetPlayerMoney(playerid) < 50) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough cash.");
GivePlayerMoney(playerid, -50);
GetPlayerHealth(playerid,hp);
SetPlayerHealth(playerid,hp+25);
}
case 2:
{
if(GetPlayerMoney(playerid) < 15) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough cash.");
GivePlayerMoney(playerid, -15);
GetPlayerHealth(playerid,hp);
SetPlayerHealth(playerid,hp+35);
}
case 3:
{
if(GetPlayerMoney(playerid) < 75) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough cash.");
GivePlayerMoney(playerid, -75);
GetPlayerHealth(playerid,hp);
SetPlayerHealth(playerid,hp+40);
}
case 4:
{
if(GetPlayerMoney(playerid) < 100) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough cash.");
GivePlayerMoney(playerid, -100);
GetPlayerHealth(playerid,hp);
SetPlayerHealth(playerid,hp+50);
}
}
}
return 0;
}
if(dialogid == danielsbar)
{
if(response)
{
switch(listitem)
{
case 0:
{
if(GetPlayerMoney(playerid) < 25) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough cash.");
GivePlayerMoney(playerid, -25);
GetPlayerHealth(playerid,hp);
SetPlayerHealth(playerid,hp+15);
}
case 1:
{
if(GetPlayerMoney(playerid) < 50) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough cash.");
GivePlayerMoney(playerid, -50);
GetPlayerHealth(playerid,hp);
SetPlayerHealth(playerid,hp+25);
}
case 2:
{
if(GetPlayerMoney(playerid) < 15) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough cash.");
GivePlayerMoney(playerid, -15);
GetPlayerHealth(playerid,hp);
SetPlayerHealth(playerid,hp+35);
}
case 3:
{
if(GetPlayerMoney(playerid) < 75) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough cash.");
GivePlayerMoney(playerid, -75);
GetPlayerHealth(playerid,hp);
SetPlayerHealth(playerid,hp+40);
}
case 4:
{
if(GetPlayerMoney(playerid) < 200) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough cash.");
GivePlayerMoney(playerid, -200);
GetPlayerHealth(playerid,hp);
SetPlayerHealth(playerid,hp+50);
}
}
}
}
return 1;
}
pawn Код:
ShowPlayerDialog(playerid, russianbar, DIALOG_STYLE_LIST, "Russian Menu","Sprunk ($25)\nVodka($50) \nBeer ($15)\nWine ($75) \nRedbull ($100)", "Purchase", "Cancel");