SA-MP Forums Archive
[Help] Spawn Problem - 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: [Help] Spawn Problem (/showthread.php?tid=355834)



[Help] Spawn Problem - Jimbo01 - 01.07.2012

Код:
public OnPlayerSpawn(playerid)
{
	new house = PlayerInfo[playerid][pPhousekey];
	if(house !=-1)
	{
 	if(SpawnChange[playerid]) //If 1, then you get to your house, else spawn somewhere else
 	{
 	SetPlayerInterior(playerid,HouseInfo[playerid][hHInteriorWorld]);
  	PlayerInfo[playerid][pInt] = HouseInfo[playerid][hHInteriorWorld];
 	PlayerInfo[playerid][pLocal] = playerid+1000;
 	PlayerInfo[playerid][pVW] = playerid+1000;
	SetPlayerVirtualWorld(playerid, playerid+1000);
 	SetPlayerPos(playerid,HouseInfo[playerid][hInteriorX],HouseInfo[playerid][hInteriorY],HouseInfo[playerid][hInteriorZ]);
 	SetPlayerFacingAngle(playerid,HouseInfo[playerid][hInteriorA]);
 	SetCameraBehindPlayer(playerid);
 	GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 1);
	return 1;
	}
	}
    else if(InParty { playerid } == true)
  	{
  	SetTimerEx("OnPlayerPartySpawn", 30, false, "i", playerid);
  	}
  	return 1;
	}
That's my code. The problem is If a player owns a house and is @ the party and dies at the party he spawns at his house but it should spawn him at the party. If he is not at the party he dies he spawns at his house (it works)

Problem: Player shouldn't spawn at his house if he dies at the party ( if(InParty) )


Re: [Help] Spawn Problem - .FuneraL. - 01.07.2012

else if(InParty(playerid) == true)

Change the line and try this.