11.04.2010, 11:31
Ok, so I made a place to buy drugs, but only id 0 can buy, id 1 can't, there are no messages popping up or cash going lower. How can I get it working for all id's?
Код:
else if(dialogid == drugsdialog) // drugs { if(response) { if(listitem == 0)// Weed { if(GetPlayerMoney(playerid) < 50) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash."); GivePlayerMoney(playerid, -50); GameTextForPlayer(playerid, "~w~] You Just Bought A Gram Of Weed For $50 ]", 5000, 5); weed[playerid]+= 1; return 1; } if(listitem == 1)// Coke { if(GetPlayerMoney(playerid) < 150) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash."); GivePlayerMoney(playerid, -150); GameTextForPlayer(playerid, "~w~] You Just Bought A Gram Of Coke For $150 ]", 5000, 5); coke[playerid]+= 1; return 1; } if(listitem == 2)// Crack { if(GetPlayerMoney(playerid) < 100) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash."); GivePlayerMoney(playerid, -100); GameTextForPlayer(playerid, "~w~] You Just Bought A Gram Of Crack For $100 ]", 5000, 5); crack[playerid]+= 1; return 1; } if(listitem == 3)// Hash { if(GetPlayerMoney(playerid) < 50) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash."); GivePlayerMoney(playerid, -50); GameTextForPlayer(playerid, "~w~] You Just Bought A Gram Of Hash For $50 ]", 5000, 5); hash1[playerid]+= 1; return 1; } if(listitem == 4)// Heroin { if(GetPlayerMoney(playerid) < 200) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash."); GivePlayerMoney(playerid, -200); GameTextForPlayer(playerid, "~w~] You Just Bought A Gram Of Heroin For $200 ]", 5000, 5); heroin[playerid]+= 1; return 1; } } return 1; }