House Spawn Bug
#1

Hi guys...

I searched forums and i couldn't find how to fix this problem. The problem is that when you first enter the server and you spawn at house, you will spawn outside the house and the virtual world will be changed...

Code: (GodFather)
pawn Код:
if(house !=255 && PlayerInfo[playerid][pCekaBolnica] == 0 && PlayerInfo[playerid][pJailed] == 0)
        {
            if(PlayerInfo[playerid][pSpawn] == 1) //If 1, then you get to your house, else spawn somewhere else
            {
                SetPlayerInterior(playerid,HouseInfo[house][hInt]);
                SetPlayerVirtualWorld(playerid,HouseInfo[house][hWorld]);
                PlayerInfo[playerid][pLocal] = house;
                HouseEntered[playerid] = house;
                PlayerInfo[playerid][pInt] = HouseInfo[house][hInt];
                SetPlayerPos(playerid, HouseInfo[house][hExitx], HouseInfo[house][hExity],HouseInfo[house][hExitz]); // Warp the player
                SetPlayerFacingAngle(playerid, HouseInfo[house][hExita]);
                return 1;
            }
        }
Solution ?
Reply
#2

From the looks of your coding, why are you setting the VW and Interior to the house if their spawning outside?

I presume your wanting them to spawn outside anyway

it should be:

Код:
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
Reply
#3

Nooo..

The code is that they should spawn inside, but there is bug and the players spawn Outside with the Virtual World of the house
I Want players to spawn inside because sometimes they spawn inside and sometimes they get bugged and they spawn outside
Reply
#4

try this

Код:
for(new i = 0; i < sizeof(HouseInfo); i++)
{
	if(house !=255 && PlayerInfo[playerid][pCekaBolnica] == 0 && PlayerInfo[playerid][pJailed] == 0)
	{
		SetPlayerInterior(playerid,HouseInfo[i][hInt]);
		SetPlayerPosEx(playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity],HouseInfo[i][hExitz]);
		PlayerInfo[playerid][pLocal] = i;
		HouseEntered[playerid] = i;
		PlayerInfo[playerid][pInt] = HouseInfo[i][hInt];
		PlayerInfo[playerid][pVW] = i;
		SetPlayerVirtualWorld(playerid, i);
		break;
	}
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)