SA-MP Forums Archive
Checkpoint enter - 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: Checkpoint enter (/showthread.php?tid=605778)



Checkpoint enter - maiky1499 - 24.04.2016

I have this under OnPlayerEnterCheckPoint
Код:
for(new idx=1; idx<MAX_HOUSES; idx++)
	{
	    new zone[MAX_ZONE_NAME];
 		GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
	    new str[256];
	    if(HouseInfo[idx][hLevel])
	    {
		    if(IsPlayerInRangeOfPoint(playerid, 2, HouseInfo[idx][hX], HouseInfo[idx][hY], HouseInfo[idx][hZ]) && !Housepicked[playerid])
			{
			    if(!strcmp("The State", HouseInfo[idx][hOwner], true))
			    {
				    format(str, sizeof(str), "[%s %d] You are standing at the door of %s.", zone, idx, HouseInfo[idx][hOwner]);
				    SendClientMessage(playerid, COLOR_GREEN, str);
				    SendClientMessage(playerid, COLOR_WHITE, "Available commands: /enter, /ds(hout), /knock, /ddo");
				}
				else
				{
				    format(str, sizeof(str), "This house is for sale: %d", HouseInfo[idx][hPrice]);
				    SendClientMessage(playerid, COLOR_LIME, str);
				}
				Housepicked[playerid] = 1;
			}
		}
	}
But when I enter the server and I have serval house created it works only on house ID 1 and the others dosen't show a checkpoint


Re: Checkpoint enter - maiky1499 - 25.04.2016

bump


Re: Checkpoint enter - Jefff - 25.04.2016

pawn Код:
if(HouseInfo[idx][hOwner][0] != '\0' && !strcmp("The State", HouseInfo[idx][hOwner], true))
if HouseInfo[idx][hOwner] is empty strcmp returns true, and also use break after Housepicked[playerid] = 1;


Re: Checkpoint enter - maiky1499 - 25.04.2016

Still works normally but only on house ID1 maybe its with the idx


Re: Checkpoint enter - maiky1499 - 26.04.2016

plizz