SA-MP Forums Archive
Need Help Here +rep - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need Help Here +rep (/showthread.php?tid=661532)



Need Help Here +rep - PoniStar - 07.12.2018

hi . so i have this code :
Код:
if(newkeys == KEY_CTRL_BACK || newkeys == KEY_LOOK_BEHIND)
	{
		for(new i = 0; i < MAX_HOUSES; i++)
		{
				new pname[24];
				GetPlayerName(playerid,plname,sizeof(plname));
				if(IsPlayerInRangeOfPoint(playerid,0.8,House[i][houseX],House[i][hY],House[i][hZ]))
				{
						if(House[i][Owned] == 1 && HouseID[playerid] == i)
						{
								new string[128];

								if(House[i][doorlock] == 0)
								{
								format(string,sizeof(string),"Enter\nLock Doors");
								}
								else if(House[i][doorlock] == 1)
								{
								format(string,sizeof(string),"Enter\nOpen Doors");
								}
								ShowPlayerDialog(playerid,Dialog_House,DIALOG_STYLE_LIST,"House Config Menu",string,"Enter","Cancel");
						}
				}
		}
	}
it will always show the enter\n"LOCK Doors" menu ! 'but' it will work fine on houses that have 0 ID (i mean when the i = 0 it will work how i want ! and when the doorlock == 0 it will show LockDoors and when doorlock == 1 will show open doors option!) whats the problem with this guys ? can you help me?

sorry for my bad english


Re: Need Help Here +rep - ItsRobinson - 07.12.2018

Probably something to do with your HouseID variable, possible that it's value is 0 and that's why you're having this issue.


Re: Need Help Here +rep - PoniStar - 08.12.2018

#define MAX_HOUSES 1000