I can't enter to a bussiness, but I can enter to a house
#1

I can't enter to a bussiness, but I can enter to a house.

Код:
CMD:enter(playerid, params[])
{
	if(!LoggedIn[playerid])return true;

	if(!IsPlayerInAnyVehicle(playerid))
	{
		for(new i = 0; i < MAX_HOUSES; i++)
		{
			if(HouseData[i][HouseID] != 0)
			{
				if(IsPlayerInRangeOfPoint(playerid, 2.0,  HouseData[i][HouseExterior][0], HouseData[i][HouseExterior][1], HouseData[i][HouseInterior][2]))
				{
					if(HouseData[i][HouseLocked] == 0)
					{
						SetPlayerPos(playerid, HouseData[i][HouseInterior][0], HouseData[i][HouseInterior][1], HouseData[i][HouseInterior][2]);
						SetPlayerFacingAngle(playerid,  HouseData[i][HouseInterior][3]);
						SetPlayerInterior(playerid, HouseData[i][HouseInteriorID]);
						SetPlayerVirtualWorld(playerid, HouseData[i][HouseID]);
					}
					else return SendClientMessage(playerid, COLOR_WHITE, "Ez a hбz zбrva van!");
				}
			}
		}
		
		for(new i = 0; i < MAX_BIZ; i++)
		{
			if(BizData[i][BizID] != 0)
			{
				if(IsPlayerInRangeOfPoint(playerid, 2.0,  BizData[i][BizExterior][0], BizData[i][BizExterior][1], BizData[i][BizInterior][2]))
				{
					if(BizData[i][BizLocked] == 0)
					{
						SetPlayerPos(playerid, BizData[i][BizInterior][0], BizData[i][BizInterior][1], BizData[i][BizInterior][2]);
						SetPlayerFacingAngle(playerid,  BizData[i][BizInterior][3]);
						SetPlayerInterior(playerid, BizData[i][BizInteriorID]);
						SetPlayerVirtualWorld(playerid, BizData[i][BizID]);
					}
					else return SendClientMessage(playerid, COLOR_WHITE, "Ez a biznisz zбrva van!");
				}
			}
		}
	}
	
	return true;
}
Reply
#2

Код:
if(IsPlayerInRangeOfPoint(playerid, 2.0,  BizData[i][BizExterior][0], BizData[i][BizExterior][1], BizData[i][BizInterior][2]))
The last is interior instead of exterior

EDIT: Same for the houses. It should be the exterior. I guess it was coincidence that it works for the houses because z coordinate is close in most grounds.

Try and fix them both to Exterior
Reply
#3

Im dumb, thank you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)