SA-MP Forums Archive
Make it so cars TP with you - 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: Make it so cars TP with you (/showthread.php?tid=583177)



Make it so cars TP with you - ZachKnoxx - 26.07.2015

Hello. How would I make it so when I teleport somewhere, my car comes with me?

Код HTML:
                        if(listitem == 0) // Idlewood
                        {
                    		SetPlayerInterior(playerid, 0);
                    		SetPlayerVirtualWorld(playerid, 0);
                			SetPlayerPos(playerid, 2095.6433,-1771.5852,13.5525, 2);
                        }
That is my current code for TP'ing to idlewood. Can someone tell me how I'd make it so a car comes with me to idlewood when I TP there?


AW: Make it so cars TP with you - Macronix - 26.07.2015

Here:

Код:
if(listitem == 0) // Idlewood
{
        if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	{
		SetVehiclePos(GetPlayerVehicleID(playerid), 2095.6433,-1771.5852,13.5525);
		LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
		SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), 0);
        }
	else
	{
		SetPlayerVirtualWorld(playerid, 0);
		SetPlayerPos(playerid, 2095.6433,-1771.5852,13.5525);
	}
	SetPlayerInterior(playerid, 0);
}



Re: AW: Make it so cars TP with you - ZachKnoxx - 26.07.2015

Quote:
Originally Posted by Macronix
Посмотреть сообщение
Here:

Код:
if(listitem == 0) // Idlewood
{
        if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	{
		SetVehiclePos(GetPlayerVehicleID(playerid), 2095.6433,-1771.5852,13.5525);
		LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
		SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), 0);
        }
	else
	{
		SetPlayerVirtualWorld(playerid, 0);
		SetPlayerPos(playerid, 2095.6433,-1771.5852,13.5525);
	}
	SetPlayerInterior(playerid, 0);
}
Thanks. +REPPED.