16.03.2010, 16:49
Whats wrong with my dialog box? When i press cancel, it buy's the first thing in the list and then closes the dialog instead of just closeing it...
heres part of it:
heres part of it:
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == STORE_DIALOG) { if(response)//If player pressed not cancel { ShowPlayerDialog(playerid,STORE_DIALOG,DIALOG_STYLE_LIST,"24/7 STORE","Chainsaw ($1500)\nFlowers ($5)\nBaseball bat ($100)\nBeer ($20)\nWallet ($1000)\nParachute($500)\nCork($1000)","Choose","Cancel"); } if(listitem == 0) { if(GetPlayerMoney(playerid) <= 1499) { SendClientMessage(playerid, 0xA9A9A9AA, "|_24/7 Purchase Failed_|"); SendClientMessage(playerid, COLOR_ERROR, "You cannot afford to buy a Chainsaw ($1500)"); return 1; } GivePlayerMoney(playerid,-1500); SendClientMessage(playerid, 0xA9A9A9AA, "|_24/7 Purchase_|"); SendClientMessage(playerid, 0x00C7FFAA, "You have bought a Chainsaw. You were charged $1500"); GivePlayerWeapon(playerid,9,1); return 1; }