SA-MP Forums Archive
House problem - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: House problem (/showthread.php?tid=275825)



House problem - _ReloadeD_ - 11.08.2011

always says me the I don't near the house!
and i checked i create 2 houses and buy a one......

Code:
		else if(!strcmp(HouseSys, "enter",true))
			{
			    new hstring[128];
 				GetPlayerName(playerid, playername, sizeof(playername));
				for(new h = 0; h < MAX_HOUSES; h++)
				{
				    if (dini_Exists(hstring))
				    {
						if(dini_Int(hstring,"Lock") == 0)
						{
					    	SendClientMessage(playerid, COLOR_GRAD2,hstring);
							if(PlayerToPoint(2.0, playerid, dini_Float(hstring,"EnterX"), dini_Float(hstring,"EnterY"), dini_Float(hstring,"EnterZ")))
							{
								SetPlayerPos(playerid,dini_Float(hstring,"ExitX"), dini_Float(hstring,"ExitY"), dini_Float(hstring,"ExitZ"));
								SetPlayerInterior(playerid,dini_Int(hstring,"Int"));
								SetPlayerVirtualWorld(playerid,dini_Int(hstring,"World"));
								GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 1);
								return 1;
							}
						}
						else return GameTextForPlayer(playerid, "~w~House ~r~Locked", 5000, 6);
					}
				}
				return SendClientMessage(playerid, COLOR_GRAD2, "   You are to far from any house !");
			}//enter
			else if(!strcmp(HouseSys, "exit",true))
			{
			    new hstring[128];
 				GetPlayerName(playerid, playername, sizeof(playername));
				for(new h = 0; h < MAX_HOUSES; h++)
				{
				    SendClientMessage(playerid, COLOR_GRAD2,hstring);
				    if (dini_Exists(hstring))
				    {
				        format(hstring, sizeof(hstring), "Houses/%d.ini", h);
						if(PlayerToPoint(2.0, playerid, dini_Float(hstring,"ExitX"), dini_Float(hstring,"ExitY"), dini_Float(hstring,"ExitZ")))
						{
							SetPlayerPos(playerid,dini_Float(hstring,"EnterX"), dini_Float(hstring,"EnterY"), dini_Float(hstring,"EnterZ"));
							SetPlayerInterior(playerid,0);
							SetPlayerVirtualWorld(playerid,0);
							GameTextForPlayer(playerid, "~w~Have a nice day!", 5000, 1);
							return 1;
						}
					}
				}
				return SendClientMessage(playerid, COLOR_GRAD2, "   You are to far from any house !");
			}//exit



Re: House problem - _ReloadeD_ - 11.08.2011

ok i found the problem thanks