small problem
#4

Ok. You have a continuous loop. Use break to stop it once you have an avaliable house. I.e:

Код:
CMD:lockgarage(playerid, params[])
{
	new string[128];
	for(new i = 0; i< sizeof(GarageInfo); i++)
	{
                print("1");
		if(IsPlayerInRangeOfPoint(playerid, 5, GarageInfo[i][gExteriorX], GarageInfo[i][gExteriorY], GarageInfo[i][gExteriorZ]) || IsPlayerInRangeOfPoint(playerid, 5, 1860.0675,-2347.2207,-37.4430))
		{
                        print("2");
			if(!strcmp(HouseInfo[GarageInfo[i][gHouseID]][hOwner],GetPlayerNameEx(playerid)))
			{
                                print("3");
				if(!GarageInfo[i][gLock])
				{
					GarageInfo[i][gLock] = 1;
					format(string, sizeof(string), "* %s unlocks their garage.", RPN(playerid));
					ProxDetector(15.0, playerid, string, COLOR_ACCIONME, COLOR_ACCIONME, COLOR_ACCIONME, COLOR_ACCIONME, COLOR_ACCIONME);
					GText(playerid, "~g~Garage Unlocked", 3500, 3);
                                        print("4");
				}
				else if(GarageInfo[i][gLock])
				{
					GarageInfo[i][gLock] = 0;
					format(string, sizeof(string), "* %s locks their garage", RPN(playerid));
					ProxDetector(15.0, playerid, string, COLOR_ACCIONME, COLOR_ACCIONME, COLOR_ACCIONME, COLOR_ACCIONME, COLOR_ACCIONME);
					GText(playerid, "~r~Garage Locked", 3500, 3);
                                        print("5");
				}
				SaveGarages(i);
                                print("6");
			}
                        // so on and forth.
                        break;
		}
	}
	return 1;
}
and from the debugs you have provided, there is something wrong with strmatch. So lets replace it with strcmp for a quick test.
Reply


Messages In This Thread
small problem - by Antoniohl - 06.04.2015, 21:42
Re: small problem - by Sledgehammer - 06.04.2015, 21:52
Re: small problem - by Antoniohl - 06.04.2015, 21:54
Re: small problem - by Sledgehammer - 06.04.2015, 22:05
Re: small problem - by Antoniohl - 06.04.2015, 22:13
Re: small problem - by Sledgehammer - 06.04.2015, 22:16
Re: small problem - by Antoniohl - 06.04.2015, 22:21

Forum Jump:


Users browsing this thread: 1 Guest(s)