SA-MP Forums Archive
Problem exiting houses - 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: Problem exiting houses (/showthread.php?tid=64906)



Problem exiting houses - [IB]Scorcher - 08.02.2009

Well... I add houses, but then, when I exit a house with the same interior as the other one, I end at a diffrent house exit, help? Please.


Re: Problem exiting houses - Think - 08.02.2009

use virtual worlds.


Re: Problem exiting houses - mirkoiz - 04.03.2009

Quote:
Originally Posted by Pandabeer1337
use virtual worlds.
i use v-worlds but the same Problem


Re: Problem exiting houses - Magician - 04.03.2009

Use Virtual Worlds correctly (keyword).


Re: Problem exiting houses - linxx - 04.03.2009

Hello guys i have the same problem this is how i have done it but if anyone can help me with this to get it working that would be great you can see how im trying to do it i just need help with it

regards kry

Код:
	if(strcmp(cmd, "/enter", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
		{
			for(new i = 0; i < sizeof(HouseInfo); i++)
			{
				if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
				{
					//printf("Found House :%d",i);
					if(PlayerInfo[playerid][pPhousekey] == i || HouseInfo[i][hLock] == 0)
					{
						if(HouseInfo[i][hLevel] = 1)
						{
							SetPlayerInterior(playerid,HouseInfo[i][hInt]);
							SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
							GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 1);
							PlayerInfo[playerid][pInt] = HouseInfo[i][hInt];
							PlayerInfo[playerid][pLocal] = i;
						}
						else
						{
						  SetPlayerVirtualWorld(playerid, 7);
							SetPlayerInterior(playerid,HouseInfo[i][hInt]);
							SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
							GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 1);
							PlayerInfo[playerid][pInt] = HouseInfo[i][hInt];
							PlayerInfo[playerid][pLocal] = i;
						}
					}
					else
					{
						GameTextForPlayer(playerid, "~r~Locked", 5000, 1);
					}
				}
			}
Код:
	if(strcmp(cmd, "/exit", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
		{
			for(new i = 0; i < sizeof(HouseInfo); i++)
			{
				//printf("House :%d",i);
				if (PlayerToPoint(3, playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]))
				{
					SetPlayerInterior(playerid,0);
					SetPlayerPos(playerid,HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez]);
					PlayerInfo[playerid][pInt] = 0;
					SetPlayerVirtualWorld(playerid,0);
					PlayerInfo[playerid][pLocal] = 255;
					if(HouseInfo[i][hHel] == 1)
					{
						new Float:tempheal;
						GetPlayerHealth(playerid,tempheal);
						if(tempheal < 100.0)
						{
							SetPlayerHealth(playerid,100.0);
						}
					}
				}
			}
Код:
	if(house !=255)
		{
		  if(SpawnChange[playerid]) //If 1, then you get to your house, else spawn somewhere else
		  {
		  	if(HouseInfo[house][hLevel] <= 2)
		  	{
					SetPlayerToTeamColor(playerid);
					SetPlayerInterior(playerid,HouseInfo[house][hInt]);
					SetPlayerPos(playerid, HouseInfo[house][hExitx], HouseInfo[house][hExity],HouseInfo[house][hExitz]); // Warp the player
					PlayerInfo[playerid][pLocal] = house;
					PlayerInfo[playerid][pInt] = HouseInfo[house][hInt];
					return 1;
				}
				else
				{
					SetPlayerToTeamColor(playerid);
					SetPlayerInterior(playerid,HouseInfo[house][hInt]);
					SetPlayerPos(playerid, HouseInfo[house][hExitx], HouseInfo[house][hExity],HouseInfo[house][hExitz]); // Warp the player
					PlayerInfo[playerid][pLocal] = house;
					PlayerInfo[playerid][pInt] = HouseInfo[house][hInt];
					SetPlayerVirtualWorld(playerid, 7);
					return 1;
				}
			}
		}