Hospital doesn't work
#1

Can someone please help me with this code. The first items on the list work in this dialog but the last two (listitem 2 and 3 do not work and I cannot figure out why. They do not do what they are suppose to nor do they return anything. I can't figure it out, please help


Код:
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;
			}
			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] == 1 && 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;
			}
			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) {
					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;
				}
			}
			
		}
	}
}
Reply


Messages In This Thread
Hospital doesn't work Help please - by ruckfules99 - 01.01.2013, 06:32
Re: Hospital doesn't work - by MattSlater - 01.01.2013, 06:44
Re: Hospital doesn't work - by IRio97 - 01.01.2013, 06:49
Re: Hospital doesn't work - by ruckfules99 - 01.01.2013, 16:01

Forum Jump:


Users browsing this thread: 1 Guest(s)