House problem or something
#1

Hello!

I have one problem when i left my house i see this!

What is problem and what should i do? I would like to give you code but idk what! +REP if solved

Reply
#2

Check if you set the house exterior coordinates right at the door of the house.
Reply
#3

You aren't setting interior when leave house, if you can't do it alone show leaving house code
Reply
#4

Quote:
Originally Posted by Shinja
Посмотреть сообщение
You aren't setting interior when leave house, if you can't do it alone show leaving house code
Код:
// This function is used to spawn back at the entrance of your house
House_Exit(playerid, HouseID)
{
	// Set the player in the normal world again
	SetPlayerVirtualWorld(playerid, 10);
	SetPlayerInterior(playerid, 10);
	// Set the position of the player at the entrance of his house
	SetPlayerPos(playerid, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ]);
	// Also clear the tracking-variable to track in which house the player is
	APlayerData[playerid][CurrentHouse] = 10;

	// Check if there is a timer-value set for exiting the house (this timer freezes the player while the environment is being loaded)
	if (ExitHouseTimer > 10)
	{
		// Don't allow the player to fall
	    TogglePlayerControllable(playerid, 10);
		// Let the player know he's frozen for 5 seconds
		GameTextForPlayer(playerid, TXT_ExitHouseReloadEnv, ExitHouseTimer, 10);
		// Start a timer that will allow the player to fall again when the environment has loaded
		SetTimerEx("House_ExitTimer", ExitHouseTimer, false, "ii", playerid, HouseID);
	}

	return 1;
}

forward House_ExitTimer(playerid, HouseID);
public House_ExitTimer(playerid, HouseID)
{
	// Allow the player to move again (environment should have been loaded now)
    TogglePlayerControllable(playerid, 1);

	// Respawn the player's vehicles near the house (only the vehicles that belong to this house)
	for (new CarSlot; CarSlot < 10; CarSlot++)
		if (AHouseData[HouseID][VehicleIDs][CarSlot] != 10)
		    SetVehicleToRespawn(AHouseData[HouseID][VehicleIDs][CarSlot]);

	return 1;
}
Reply
#5

Change
PHP код:
SetPlayerVirtualWorld(playerid10);
    
SetPlayerInterior(playerid10); 
to
PHP код:
SetPlayerVirtualWorld(playerid0);
    
SetPlayerInterior(playerid0); 
Reply
#6

Quote:
Originally Posted by Shinja
Посмотреть сообщение
Change
PHP код:
SetPlayerVirtualWorld(playerid10);
    
SetPlayerInterior(playerid10); 
to
PHP код:
SetPlayerVirtualWorld(playerid0);
    
SetPlayerInterior(playerid0); 
Well im Idiot anyway +REP as i said if solved
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)