SA-MP Forums Archive
[Ajuda] Entro no interior e saio em outro lugar - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Entro no interior e saio em outro lugar (/showthread.php?tid=586590)



Entro no interior e saio em outro lugar - TheModern - 23.08.2015

Tipo, entro em um apartamento e todos os apartamentos tem o mesmo interior (Sу que em mundos diferentes) e quando saio, saio no lugar do primeiro apartamento.

Entrada:
pawn Код:
else if(PlayerToPoint(3, playerid,-1601.3732,767.6286,7.1875))
            {//Entrada Apartamentos 1
                GameTextForPlayer(playerid, "~w~Apartamento", 5000, 1);
                SetPlayerVirtualWorld(playerid, 0);
                SetPlayerInterior(playerid, 0);
                SetPlayerPos(playerid,1312.5664,-1048.2203,3353.9048);
                PlayerInfo[playerid][pInt] = 0;
            }
            else if(PlayerToPoint(3, playerid,-1697.5094,883.7151,24.8982))
            {//Entrada Apartamentos 2
                GameTextForPlayer(playerid, "~w~Apartamento", 5000, 1);
                SetPlayerVirtualWorld(playerid, 1);
                SetPlayerInterior(playerid, 0);
                SetPlayerPos(playerid,1312.5664,-1048.2203,3353.9048);
                PlayerInfo[playerid][pInt] = 0;
            }
Saнda:
pawn Код:
else if (PlayerToPoint(3.0, playerid,1312.5664,-1048.2203,3353.9048))
            {//Saida Apartamento 1
                SetPlayerPos(playerid, -1601.3732,767.6286,7.1875);
                SetPlayerVirtualWorld(playerid, 0);
                SetPlayerInterior(playerid,0);
                SetPlayerFacingAngle(playerid, 0);
                PlayerInfo[playerid][pInt] = 0;
                PlayerInfo[playerid][pLocal] = 255;
            }
            else if (PlayerToPoint(3.0, playerid,1312.5664,-1048.2203,3353.9048))
            {//Saida Apartamento 2
                SetPlayerPos(playerid, 1710.433715,-1669.379272,20.225049);
                SetPlayerVirtualWorld(playerid, 0);
                SetPlayerInterior(playerid,0);
                SetPlayerFacingAngle(playerid, 0);
                PlayerInfo[playerid][pInt] = 0;
                PlayerInfo[playerid][pLocal] = 255;
            }



Re: Entro no interior e saio em outro lugar - RafaelOsio - 23.08.2015

Код:
new EntrouAP[MAX_PLAYERS]; No topo.

//Entradas
else if(PlayerToPoint(3, playerid,-1601.3732,767.6286,7.1875))
{
	GameTextForPlayer(playerid, "~w~Apartamento", 5000, 1);
	SetPlayerVirtualWorld(playerid, 0);
	SetPlayerInterior(playerid, 0);
	SetPlayerPos(playerid,1312.5664,-1048.2203,3353.9048);
	PlayerInfo[playerid][pInt] = 0;
	EntrouAP[playerid] = 1;
}
else if(PlayerToPoint(3, playerid,-1697.5094,883.7151,24.8982))
{
	GameTextForPlayer(playerid, "~w~Apartamento", 5000, 1);
	SetPlayerVirtualWorld(playerid, 1);
	SetPlayerInterior(playerid, 0);
	SetPlayerPos(playerid,1312.5664,-1048.2203,3353.9048);
	PlayerInfo[playerid][pInt] = 0;
	EntrouAP[playerid] = 2;
}
//Saнdas
else if (PlayerToPoint(3.0, playerid,1312.5664,-1048.2203,3353.9048))
{
	switch(EntrouAP[playerid])
	{
		case 1:
		{
			SetPlayerPos(playerid, -1601.3732,767.6286,7.1875);
			SetPlayerVirtualWorld(playerid, 0);
			SetPlayerInterior(playerid,0);
			SetPlayerFacingAngle(playerid, 0);
			PlayerInfo[playerid][pInt] = 0;
			PlayerInfo[playerid][pLocal] = 255;
		}
		case 2:
		{
			SetPlayerPos(playerid, 1710.433715,-1669.379272,20.225049);
			SetPlayerVirtualWorld(playerid, 0);
			SetPlayerInterior(playerid,0);
			SetPlayerFacingAngle(playerid, 0);
			PlayerInfo[playerid][pInt] = 0;
			PlayerInfo[playerid][pLocal] = 255;
		}
	}
}
Percebeu a diferenзa ? O valor da variбvel й atribuнda dependendo do apartamento que o player entrou. Ao sair, apenas faz um teste com este valor. Caso seja X, sete o player em Y. Qualquer dъvida avisa.