01.01.2013, 17:10
For some reason all my items in the dialog list work except for listitem 3. It doesn't do anything, not even return a message. What's the problem? I don't understand why its doing it.
Код:
if(dialogid==HOSPITAL_DIALOG) { new Float:health; GetPlayerHealth(playerid, health); if(response) { ShowPlayerDialog(playerid,HOSPITAL_DIALOG,2,"Los Santos Hospital","Buy Health $1000 Full Health Restore\nBuy Cure $4500 Infections Cure\nBuy Health & Cure $5000 Health Restore & Infections Cured\nBuy Injections $10000 5 Injections For Cops","Select","Cancel"); if(listitem==0) { if(GetPlayerMoney(playerid) <= 999) { SendClientMessage(playerid, 0xA9A9A9AA, "-HOSPITAL- PURCHASE FAIL"); SendClientMessage(playerid, COLOR_ERROR, "You Cannot Afford Medical Services"); return 1; } if(health == 100) { SendClientMessage(playerid,COLOR_ERROR,"You do not require medical services"); return 1; } GivePlayerMoney(playerid,-1000); SetPlayerHealth(playerid,100.0); SendClientMessage(playerid, 0xA9A9A9AA, "-HOSPITAL- PURCHASE"); SendClientMessage(playerid, 0x00C7FFAA, "You have been healed by the hospital"); return 1; } if(listitem==1) { if(GetPlayerMoney(playerid) <= 4499) { SendClientMessage(playerid, 0xA9A9A9AA, "-HOSPITAL- PURCHASE FAIL"); SendClientMessage(playerid, COLOR_ERROR, "You Cannot Afford Medical Services"); return 1; } if(health == 100) { SendClientMessage(playerid, 0xA9A9A9AA, "-HOSPITAL- PURCHASE FAIL"); SendClientMessage(playerid, COLOR_ERROR, "You do not require medical services"); return 1; } if(Chlamydia[playerid] == 1) { GivePlayerMoney(playerid,-4500); Chlamydia[playerid] =0; SendClientMessage(playerid, 0xA9A9A9AA, "-HOSPITAL- PURCHASE"); SendClientMessage(playerid, 0x00C7FFAA, "You have been cured of infections by the hospital"); return 1; } return 1; } if(listitem==2) { if(GetPlayerMoney(playerid) <= 4999) { SendClientMessage(playerid, 0xA9A9A9AA, "-HOSPITAL- PURCHASE FAIL"); SendClientMessage(playerid, COLOR_ERROR, "You Cannot Afford Medical Services"); return 1; } if(Chlamydia[playerid] == 0 && health == 100) { SendClientMessage(playerid,COLOR_ERROR,"You do not require medical services"); return 1; } GivePlayerMoney(playerid,-5000); SetPlayerHealth(playerid,100.0); Chlamydia[playerid] =0; SendClientMessage(playerid, 0xA9A9A9AA, "-HOSPITAL- PURCHASE"); SendClientMessage(playerid, 0x00C7FFAA, "You have been healed/cured by the hospital"); return 1; } return 1; } if(listitem==3) { if(GetPlayerMoney(playerid) <= 9999) { SendClientMessage(playerid, 0xA9A9A9AA, "-HOSPITAL- PURCHASE FAIL"); SendClientMessage(playerid, COLOR_ERROR, "You Cannot Afford To Buy Injections"); return 1; } if(gTeam[playerid] != TEAM_COP && gTeam[playerid] != TEAM_ARMY && gTeam[playerid] != TEAM_MARINE && gTeam[playerid] != TEAM_AIRSUPPORT && gTeam[playerid] != TEAM_BOUNTY && gTeam[playerid] != TEAM_SWAT) { SendClientMessage(playerid,COLOR_ERROR,"Only Law Enforcment agents can buy injections"); return 1; } GivePlayerMoney(playerid,-10000); PlayerDrugs[playerid] += 5; SendClientMessage(playerid, 0xA9A9A9AA, "-HOSPITAL- PURCHASE"); SendClientMessage(playerid, 0x00C7FFAA, "You have bought 5 injections from the hospital"); SendClientMessage(playerid, 0x00C7FFAA, "Use /inject [amount] to heal yourself"); return 1; } return 1; }