09.02.2015, 03:40
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { new string[128]; if(dialogid == DIALOG_SHOP) { if(!response) { SendClientMessage(playerid, -1, "Thank you for visiting the store!"); } else { switch(listitem) { case 0: { ShowPlayerDialog(playerid, DIALOG_SELLGOLD, DIALOG_STYLE_INPUT, "Sell your gold:","Enter amount:", "OK", "CANCEL"); } case 1: { ShowPlayerDialog(playerid, DIALOG_SELLIRON, DIALOG_STYLE_INPUT, "Sell your gold:","Enter amount:", "OK", "CANCEL"); } } } return 1; } if(dialogid == DIALOG_SELLGOLD) { if(!response) { SendClientMessage(playerid, -1, "Thank you for visiting the store!"); } else { //if(gold[playerid]<inputtext[DIALOG_SELLGOLD]) return SendClientMessage(playerid, -1, "You dont have that much gold!"); gold[playerid] -= inputtext[2]; format(string, sizeof(string),"You sold %i gold for %i", inputtext[2],gold[playerid]*2500); SendClientMessage(playerid, -1, string); } } if(dialogid == DIALOG_SELLIRON) { if(!response) { SendClientMessage(playerid, -1, "Thank you for visiting the store!"); } else { if(inputtext[playerid] > gold[playerid]) return SendClientMessage(playerid, -1, "You dont have that much iron!"); gold[playerid] -= inputtext[playerid]; format(string, sizeof(string),"You sold %i iron for %i", inputtext[playerid],gold[playerid]*500); SendClientMessage(playerid, -1, string); } } return 0; }
Im lost