SA-MP Forums Archive
PutPlayerInVehicle - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP (https://sampforum.blast.hk/forumdisplay.php?fid=3)
+--- Forum: Bug Reports (https://sampforum.blast.hk/forumdisplay.php?fid=20)
+--- Thread: PutPlayerInVehicle (/showthread.php?tid=110020)



PutPlayerInVehicle - Mikep. - 23.11.2009

When PutPlayerInVehicle is used on a player that's in a vehicle, they stay in that vehicle for other players until that vehicle is destroyed.

Very annoying bug.


Re: PutPlayerInVehicle - Chaprnks - 26.11.2009

Possible temporary fix, if you don't already use. Also would fix the bug of putting a player in any seat that someone else is already in.

pawn Code:
// Has to go before all the PutPlayerInVehicle's, or you can manually rename all them to whatever.
public SafePutPlayerInVehicle(playerid, vehicleid, seatid)
{
    foreach(Player, i)
    {
        if(GetPlayerVehicleID(i) == vehicleid && GetPlayerVehicleSeat(i) == seatid)
        {
            return 0;
        }
    }
    PutPlayerInVehicle(playerid, vehicleid, seatid);
    return 1;
}

#define PutPlayerInVehicle SafePutPlayerInVehicle



Re: PutPlayerInVehicle - Jay_ - 27.11.2009

There's also an issue using PutPlayerInVehicle when using special actions, such as smoking and drinking. It teleports the player out of the vehicle immediately. Note that before someone mentions it, using SPECIAL_ACTION_NONE before the function call does nothing.


Re: PutPlayerInVehicle - Rac3r - 27.11.2009

We had the same issue, with the new beer and ciggy actions. Players would not be put in their vehicles.
Just a shame we have to remove their actions before putting them in a vehicle.
Code:
  xInfo[playerid][vehicle]=vehicleid;
  SetPlayerSpecialAction(playerid,0);
  PutPlayerInVehicle(playerid,vehicleid,seat);
  return 1;
}