SA-MP Forums Archive
Car Passenger does not TP with. - 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: Car Passenger does not TP with. (/showthread.php?tid=444117)



Car Passenger does not TP with. - Stefand - 15.06.2013

I made a garage system for PD vehicles, but when I try to enter it with a criminal in the back Only I get tp'd with the car, not the suspect.

pawn Код:
command(getin, playerid, params[])
{
    if(Factions[Player[playerid][Faction]][CommandTypes] == 1)
    {
        if(IsPlayerInRangeOfPoint(playerid, 10.0, 1588.4719,-1632.7593,13.1078))
        {
            new playercar = GetPlayerVehicleID(playerid);
            new playerseat = GetPlayerVehicleSeat(playerid);
            if(IsPlayerInAnyVehicle(playerid))
            {
                for(new i = 0; i != MAX_PLAYERS; i++)
                {
                    if(IsPlayerInVehicle(i, playercar))
                    {
                        new passengerseat = GetPlayerVehicleSeat(i);
                        SetPlayerVirtualWorld(i, 500);
                        SetPlayerInterior(i, 1);
                        PutPlayerInVehicle(i, playercar, passengerseat);
                    }
                }
                LinkVehicleToInterior(playercar, 1);
                SetVehicleVirtualWorld(playercar, 500);
                SetPlayerVirtualWorld(playerid, 500);
                SetPlayerInterior(playerid, 1);
                SetVehiclePos(playercar, 2313.2419,2445.9133,-39.3668);
                SetVehicleZAngle(playercar, 90);
                PutPlayerInVehicle(playerid, playercar, playerseat);
                SetVehicleZAngle(playercar, 90);
            }
        }
    }
    return 1;
}



Re: Car Passenger does not TP with. - Stefand - 16.06.2013

BUMB


Re: Car Passenger does not TP with. - Stefand - 18.06.2013

Bumb


Re: Car Passenger does not TP with. - JJB562 - 18.06.2013

The code seems correct. See if this works:

pawn Код:
command(getin, playerid, params[])
{
    if(Factions[Player[playerid][Faction]][CommandTypes] == 1)
    {
        if(IsPlayerInRangeOfPoint(playerid, 10.0, 1588.4719,-1632.7593,13.1078))
        {
            new playercar = GetPlayerVehicleID(playerid);
            if(IsPlayerInAnyVehicle(playerid))
            {
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    if(IsPlayerConnected(i))
                    {
                        if(IsPlayerInVehicle(i, playercar))
                        {
                            SetPlayerVirtualWorld(i, 500);
                            SetPlayerInterior(i, 1);
                        }
                    }
                }
               
                LinkVehicleToInterior(playercar, 1);
                SetVehicleVirtualWorld(playercar, 500);
                SetVehiclePos(playercar, 2313.2419,2445.9133,-39.3668);
                SetVehicleZAngle(playercar, 90);
                SetPlayerVirtualWorld(playerid, 500);
                SetPlayerInterior(playerid, 1);
            }
        }
    }
    return 1;
}



Re: Car Passenger does not TP with. - Stefand - 18.06.2013

LOL i think I know what i did wrong, i did the place back in car thing and after that it tps the vehicle..