[Help] /exit command
#1

I made houses with same interiors and different virtual worlds... But when i enter /exit cmd i can't exit from house... Dunno why...

Here's my /exit cmd:

Код:
if(strcmp(cmd, "/exit", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
		{
      for(new i = 0; i < sizeof(HouseInfo); i++)
			{
				if (PlayerToPoint(3, playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]))
				{
				  if(HouseEntered[playerid] == i)
				  {
						SetPlayerInterior(playerid,0);
						SetPlayerVirtualWorld(playerid,HouseInfo[i][hWorld]);
						SetPlayerPos(playerid,HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez]);
						PlayerInfo[playerid][pInt] = 0;
						PlayerInfo[playerid][pLocal] = 255;
						SetPlayerVirtualWorld(playerid,0);
						HouseEntered[playerid] = 255;
					}
				}
			}
		}
	}
Can anyone please tell me how to exit from house?
Reply
#2

It'd be quicker to have the

if(HouseEntered[playerid] == i)

...before the ...

PlayerToPoint

I doubt that's the problem though.. Make sure that HouseEntered is being set properly, and use debug messages at every level to see where it's going wrong.
Reply
#3

I dont really see any problem with that command but make sure you have "HouseEntered[playerid] = 1;" in /enter command. Also put "HouseEntered[playerid] = 0;" under OnPlayerConnect(playerid)
Reply
#4

Did you made HouseEntered[playerid] = i; at /enter or spawn?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)