20.07.2011, 04:42
I have my Dialog list working exept for one thing when i press cancel it still takes the money away from you.
This is the actual dialog box:
This is the code behind the dialog:
This is the actual dialog box:
Код:
if(pickupid == noob247)
{
ShowPlayerDialog(playerid, DIALOG_NOOB247, DIALOG_STYLE_LIST, "24/7 Shopping Cart", "Test1($10)\nTest2($20)\nTest3($30)", "Purchase","Cancel");
}
Код:
case DIALOG_NOOB247:
{
switch(listitem)
{
case 0:
{
if(GetPlayerMoney(playerid) < 10) return SendClientMessage(playerid, COLOUR_YELLOW, "You cant afford this item.");
GivePlayerMoney(playerid, -10);
}
case 1:
{
if(GetPlayerMoney(playerid) < 20) return SendClientMessage(playerid, COLOUR_YELLOW, "You cant afford this item.");
GivePlayerMoney(playerid, -20);
}
case 2:
{
if(GetPlayerMoney(playerid) < 30) return SendClientMessage(playerid, COLOUR_YELLOW, "You cant afford this item.");
GivePlayerMoney(playerid, -30);
}
case 3:
{
return SendClientMessage(playerid, COLOUR_YELLOW, "You cant afford this item.");
}
}

