SA-MP Forums Archive
[Help] Key to exit house/bizzes - 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] Key to exit house/bizzes (/showthread.php?tid=147363)



[Help] Key to exit house/bizzes - Uninvited - 11.05.2010

Код:
if ((newkeys & KEY_SECONDARY_ATTACK) && !(oldkeys & KEY_SECONDARY_ATTACK))
	{
	  for(new i = 0; i <MAX_HOUSES; i++)
		{
		  if(PlayerToPoint(6, playerid, HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]))
			{
    			new houseid = IsPlayerInHouse[playerid];
				if(HouseInfo[houseid][hVec] == 508)
				{
   				SetPlayerInterior(playerid, 0);
					SetPlayerVirtualWorld(playerid, 0);
					IsPlayerInHouse[playerid] = INVALID_HOUSE_ID;
					PutPlayerInVehicle(playerid, houseid+1, 0);
					RemovePlayerFromVehicle(playerid);
					return 1;
				}
				else
				{
					SetPlayerPos(playerid, HouseInfo[houseid][hEntrancex], HouseInfo[houseid][hEntrancey], HouseInfo[houseid][hEntrancez]);
					SetPlayerInterior(playerid, 0);
					SetPlayerVirtualWorld(playerid, 0);
					IsPlayerInHouse[playerid] = INVALID_HOUSE_ID;
					return 1;
  }
			}
		}
		for(new i = 0; i <MAX_BUSINESSES; i++)
		{
		  if(PlayerToPoint(6, playerid, BusinessInfo[i][bExitx], BusinessInfo[i][bExity], BusinessInfo[i][bExitz]))
			{
				new playerworld = GetPlayerVirtualWorld(playerid);
				SetPlayerPos(playerid, BusinessInfo[playerworld-1][bEntrancex], BusinessInfo[playerworld-1][bEntrancey], BusinessInfo[playerworld-1][bEntrancez]);
				SetPlayerInterior(playerid, 0);
				SetPlayerVirtualWorld(playerid, 0);
				return 1;
			}
		}
		if(IsPlayerInAnyVehicle(playerid))
		{
			RemovePlayerFromVehicleEx(playerid);
			TogglePlayerControllable(playerid, true);
		}
		return 1;
	}
I used above to get out of a house / biz with the enter/f key (2nd fire) but it doesnt work however it did work for the entering of buildings(well with another script).

BTW I copied it from /exit command and put the key statement in it so it might be that :O

How can I make it work?


Re: [Help] Key to exit house/bizzes - Uninvited - 13.05.2010

Someone?