Make it so cars TP with you
#1

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?
Reply
#2

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);
}
Reply
#3

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)