SA-MP Forums Archive
[Help] /exit command - 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: [Help] /exit command (/showthread.php?tid=83609)



[Help] /exit command - Borleon - 26.06.2009

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?


Re: [Help] /exit command - Weirdosport - 26.06.2009

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.


Re: [Help] /exit command - Stah - 26.06.2009

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)


Re: [Help] /exit command - killerx100 - 12.07.2009

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