SA-MP Forums Archive
Teleport available only for faction. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Teleport available only for faction. (/showthread.php?tid=206319)



Teleport available only for faction. - Kuruskt - 03.01.2011

Hello, I'm very new to Pawno and that's why I'm asking this very dumb question.

So, here's the code:

Код:
	else if (PlayerToPointStripped(1, playerid,1173.4712,-1362.9010,13.9723, cx,cy,cz))
	{
		// Teleport
		SetPlayerPos(playerid, 1168.4231,-1347.8389,26.6489);
		SetPlayerInterior(playerid,0);
		SetPlayerFacingAngle(playerid, 270);
		PlayerInfo[playerid][pInt] = 0;
	}
How do I make it available only for one faction? (I'm using LA-RP) because this code doesn't function:

Код:
	else if (PlayerToPointStripped(1, playerid,1173.4712,-1362.9010,13.9723, cx,cy,cz))
	{
		// Teleport
                if(PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4)//model
		SetPlayerPos(playerid, 1168.4231,-1347.8389,26.6489);
		SetPlayerInterior(playerid,0);
		SetPlayerFacingAngle(playerid, 270);
		PlayerInfo[playerid][pInt] = 0;
	}



Re: Teleport available only for faction. - _rAped - 03.01.2011

That if() is not right.
pawn Код:
else if (PlayerToPointStripped(1, playerid,1173.4712,-1362.9010,13.9723, cx,cy,cz))
    {
        // Teleport
        if(PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4)//model
        {
            SetPlayerPos(playerid, 1168.4231,-1347.8389,26.6489);
            SetPlayerInterior(playerid,0);
            SetPlayerFacingAngle(playerid, 270);
            PlayerInfo[playerid][pInt] = 0;
        }
    }



Re: Teleport available only for faction. - Kuruskt - 03.01.2011

Fantastic, it worked! Thank you.