[Help] Key to exit house/bizzes
#1

Код:
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?
Reply
#2

Someone?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)