House Spawn Bug - 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)
+--- Thread: House Spawn Bug (
/showthread.php?tid=415013)
House Spawn Bug -
NeroX98 - 11.02.2013
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 ?
Re: House Spawn Bug -
Shaneisace - 11.02.2013
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);
Re: House Spawn Bug -
NeroX98 - 11.02.2013
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
Re: House Spawn Bug -
Shaneisace - 11.02.2013
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;
}
}