3 houses 1 interior?
#1

What i need to add in my /enter scirpt and /exit script to make different virtual worlds
for 3 houses in the same cordinations and the same interior
Here is my /enter script and /exit


Код:
	if(strcmp(cmd, "/enter", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
		{
			for(new i = 0; i < sizeof(ApartmentInfo); i++)
			{
				if (PlayerToPoint(3, playerid,ApartmentInfo[i][aEntrancex], ApartmentInfo[i][aEntrancey], ApartmentInfo[i][aEntrancez]))
				{
					//printf("Found House :%d",i);
					if(PlayerInfo[playerid][pPapptkey] >= 0 || ApartmentInfo[i][aLock] == 0)
					{
						SetPlayerVirtualWorld(playerid,ApartmentInfo[i][aVirtualWorld]);
						SetPlayerInterior(playerid,ApartmentInfo[i][aInt]);
						SetPlayerPos(playerid,ApartmentInfo[i][aExitx],ApartmentInfo[i][aExity],ApartmentInfo[i][aExitz]);
						GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 1);
						PlayerInfo[playerid][pVirtualWorld] = ApartmentInfo[i][aVirtualWorld];
						PlayerInfo[playerid][pInt] = ApartmentInfo[i][aInt];
						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;
					PlayerInfo[playerid][pLocal] = 255;
					if(HouseInfo[i][hHel] == 1)
					{
						new Float:tempheal;
						GetPlayerHealth(playerid,tempheal);
						if(tempheal < 100.0)
						{
							SetPlayerHealth(playerid,100.0);
						}
					}
				}
			}
			for(new i = 0; i < sizeof(ApartmentInfo); i++)
			{
				//printf("House :%d",i);
				if (PlayerToPoint(3, playerid,2365.0024,-1133.2439,1050.8750))
				{
					SetPlayerVirtualWorld(playerid,1);
					SetPlayerPos(playerid,1728.8723,-1668.8131,22.6094);
//					SetPlayerPos(playerid,ApartmentInfo[i][aEntrancex],ApartmentInfo[i][aEntrancey],ApartmentInfo[i][aEntrancez]);
					SetPlayerInterior(playerid,18);
					PlayerInfo[playerid][pVirtualWorld] = 0;
					PlayerInfo[playerid][pLocal] = 255;
					PlayerInfo[playerid][pInt] = 0;
				}
				else if(PlayerToPoint(3, playerid, 243.7802,305.0925,999.1484))
				{
					SetPlayerVirtualWorld(playerid,0);
					SetPlayerPos(playerid,2470.4888,-1402.2050,28.8333);
//					SetPlayerPos(playerid,ApartmentInfo[i][aEntrancex],ApartmentInfo[i][aEntrancey],ApartmentInfo[i][aEntrancez]);
					SetPlayerInterior(playerid,0);
					PlayerInfo[playerid][pVirtualWorld] = 0;
					PlayerInfo[playerid][pLocal] = 255;
					PlayerInfo[playerid][pInt] = 0;
				}
			}
Thanks for helping


Reply
#2

Im Really need answer :/
Reply
#3

Quote:
Originally Posted by Ben147
Im Really need answer :/
Do you just need it so if you enter 1 house you exit out infront of the same house?
Or are you just asking for people in house A not to see the people in house B even though it is same interior?
Reply
#4

i have 3houses with the same interior but if i exit from the house i exit in different house the other with the same intirior
i need help with my codes to add virtual worlds that if i have 3 houses with the same interior that will change the virual worlds to the 3 houses 0,1,2.
Reply
#5

i havent actually read anything, i saw was somthing about 3 houses with 1 interior..

when u enter a house...change virtual world to...3 for example,,and u when u exit...say


WARNING: that is not code, that is layout of it
Код:
 if (playertopoint(blahblah) && Virtualworld is 3)
{
teleport stuff
}
Reply
#6

SOLVED
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)