I NEED HELP FAST.
#1

Код:
  	if(newkeys & KEY_SPRINT)
    {
		for(new maID = 0; maID <= MAX_HOUSES; maID++)
		{
	  		if(PlayerToPoint(2.0, playerid, HouseInfo[maID][mPickupX], HouseInfo[maID][mPickupY], HouseInfo[maID][mPickupZ]))
     		{
 		   	SetPlayerPos(playerid, HouseInfo[maID][mIntX], HouseInfo[maID][mIntY], HouseInfo[maID][mIntZ]);
  			SetPlayerInterior(playerid, HouseInfo[maID][mInterior]);
  			}
		    if(PlayerToPoint(2.0, playerid, HouseInfo[maID][mIntX], HouseInfo[maID][mIntY], HouseInfo[maID][mIntZ]))
			{
       		SetPlayerPos(playerid, HouseInfo[maID][mPickupX], HouseInfo[maID][mPickupY], HouseInfo[maID][mPickupZ]);
	   		SetPlayerInterior(playerid, 0);
		    }
		}
  	}
Problem is that I enter in one house, but I exit in the other, because houses have same interior, How can i fix this.
Please help :S
Reply
#2

You can always set players virtual world when he enters the house and then check for it when he exits.

Or

Use houses by ID's and when players enters house with ID: 1 set his PVarInt to house ID, and when he exits you can simply find house by it's ID and teleport the player to house[ID][exitX][exitY][exitZ].
Reply
#3

Can you do me an example PLEAASE ?
With pVars.
Reply
#4

When player enters the house you need to chech what is house ID ( I'm gonna pretend it's 1)

So, when player enters house
pawn Код:
SetPVarInt(playerid, "InHouseID", /*Here you put your code to set house ID to player, mine is ->*/1);
And when he exits the house
pawn Код:
new hID = GetPVarInt(playerid, "InHouseID"));
//Open the file where you have your houses saved and just...
SetPlayerPos(playerid, House[hID][exitX], House[hID][exitY], House[hID][exitZ]);
Something like this...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)