Help me - My /scrapcar isn't working.
#7

i rearranged the "else" statements. give it a try
a single line for each bracket made it easier...
Код:
if(strcmp(cmd, "/scrapcar", true) == 0)
{
	if(IsPlayerConnected(playerid))
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
			if(IsPlayerInArea(playerid, 214.973251, 208.995681, 27.271835, 22.040054)==1)
			{
				PlayerInfo[playerid][pMaterials] + 60;
				PlayerActionMessage(playerid,15.0,"cuts his car into small pieces, and gets 60 blocks of scrap metal from it.");
			}
			else
			{
			SendClientMessage(playerid, COLOR_WHITE, "[ERROR:] You must be at the warehouse to scrap your car.");
			}
		}
		else
		{
			SendClientMessage(playerid, COLOR_WHITE, "[ERROR:] You must be driving a car to scrap it.");
		}
	}
	else
	{
		SendClientMessage(playerid, COLOR_WHITE, "[ERROR:] Login first.");//this will print out a text to a not-connected player?
	}
	return 1;
}
if someone now wants to complain about me blowing up the code, then have a look at this line:
Код:
if(strcmp(cmd, "/scrapcar", true) == 0){if(IsPlayerConnected(playerid)){if(IsPlayerInAnyVehicle(playerid)){if(IsPlayerInArea(playerid, 214.973251, 208.995681, 27.271835, 22.040054)==1){PlayerInfo[playerid][pMaterials] + 60;PlayerActionMessage(playerid,15.0,"cuts his car into small pieces, and gets 60 blocks of scrap metal from it.");}else{SendClientMessage(playerid, COLOR_WHITE, "[ERROR:] You must be at the warehouse to scrap your car.");}}else{SendClientMessage(playerid, COLOR_WHITE, "[ERROR:] You must be driving a car to scrap it.");}}else{SendClientMessage(playerid, COLOR_WHITE, "[ERROR:] Login first.");//this will print out a text to a not-connected player?}return 1;}
-no comment-
Reply


Messages In This Thread
Help me - My /scrapcar isn't working. - by jameskmonger - 08.01.2010, 09:01
Re: Help me - My /scrapcar isn't working. - by bajskorv123 - 08.01.2010, 09:06
Re: Help me - My /scrapcar isn't working. - by jameskmonger - 08.01.2010, 09:15
Re: Help me - My /scrapcar isn't working. - by Faraday - 08.01.2010, 09:18
Re: Help me - My /scrapcar isn't working. - by jameskmonger - 08.01.2010, 09:23
Re: Help me - My /scrapcar isn't working. - by Lajko1 - 08.01.2010, 15:44
Re: Help me - My /scrapcar isn't working. - by Babul - 08.01.2010, 16:15
Re: Help me - My /scrapcar isn't working. - by jameskmonger - 08.01.2010, 16:33
Re: Help me - My /scrapcar isn't working. - by darkbrendan6 - 02.10.2011, 16:37
Re: Help me - My /scrapcar isn't working. - by darkbrendan6 - 02.10.2011, 16:39

Forum Jump:


Users browsing this thread: 4 Guest(s)